如何将特定的usb鼠标模型配置为左撇子?
我在办公室使用右手USB鼠标,在家中使用左手usb鼠标在同一台Ubuntu 11.04笔记本电脑上。 如何将家中的一个配置为在插入时自动设置为左手?
教程
打开一个终端,在/ etc / X11 /目录下创建一个名为xorg.conf.d的文件夹并导航到它:
sudo mkdir /etc/X11/xorg.conf.d cd /etc/X11/xorg.conf.d/
在此文件夹中,创建一个名为00-mouse-remap.conf的文件,以便打开文本编辑器:
sudo gedit 00-mouse-remap.conf
X Server应扫描此目录以查找在引导时加载的自定义X11脚本。 因此,下一步是将类似于此的配置设置复制到刚刚打开的00-mouse-remap.conf文件中(根据您的意愿进行自定义):
Section "InputClass" Identifier "Microsoft Bluetooth Mouse 5000 button remap" MatchProduct "Microsoft Bluetooth Notebook Mouse 5000" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" Driver "evdev" Option "SendCoreEvents" "true" Option "Buttons" "8" Option "ButtonMapping" "3 2 1 4 5 0 7 0" EndSection
由于这是针对特定产品进行映射的,因此您应该为左手和右手鼠标配置单独的配置。 :P
您可以通过输入终端找到您的设备名称:
xinput list
然后,您需要编辑gnome配置条目,因此运行(在终端中或使用ALT + F2将其键入运行会话):
gconf-editor
(如果您已升级到使用dconf的版本,即11.10以及之后的所有内容,请改为运行dconf-editor)
然后导航到此条目,并取消选中活动条目旁边的框:
apps > gnome_settings_daemon > plugins > mouse
(在dconf的情况下,是组织> gnome> settings_daemon>插件>鼠标)
请注意,这会在GUI中修改指针设置时禁用Gnome鼠标指针设置。 因此,如果您想使用鼠标设置GUI,则必须重新激活它 – 尽管它可以接管您的新左侧设置。 ^^
例子
例如,我的xinput列表是:
⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Acer T230H id=8 [slave pointer (2)] ⎜ ↳ Logitech USB Gaming Mouse id=9 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Power Button id=7 [slave keyboard (3)] ↳ Apple, Inc Apple Keyboard id=10 [slave keyboard (3)] ↳ Apple, Inc Apple Keyboard id=11 [slave keyboard (3)]
所以我将配置我的00-mouse-remap.conf看起来像这样:
Section "InputClass" Identifier "Logitech USB Gaming Mouse button remap" MatchProduct "Logitech USB Gaming Mouse" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" Driver "evdev" Option "SendCoreEvents" "true" Option "Buttons" "8" Option "ButtonMapping" "3 2 1 4 5 0 7 0" EndSection
参考文献:
Ubuntu论坛由walkeraj发布