So I got the Logitech wireless touchpad today, did a quick search on google and confirmed it works on linux. Naturally I assumed it interacted as a multitouch touchpad just like a synaptics touchpad. Well from my initial findings it does not. It seems to take on the role of interpreting the multitouch events on the device and send keyboard presses for different events. These are, of course, mapped to common keyboard commands on Windows. After a little playing with the device, which out of the box works great on linux, I started to figure out the keyboard commands. This is where my very recent trials getting the very awesome Razer Anasi working with all macro keys working came in handy. From what I learned through this simple post http://askubuntu.com/questions/69804/how-do-i-change-the-keymap-of-a-single-device-logitech-presenter I knew I could remap the keyboard events to whatever key I wanted. Using this command
sudo /lib/udev/keymap -i /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse
I figured out the scan codes for all the gesuteres logitech talks about on this page http://logitech-en-amr.custhelp.com/app/answers/detail/a_id/26426/~/gesture-navigation-with-the-logitech-wireless-touchpad
Here is my "map" of the gestures
Three Down
scan code: 0x7004E key code: pagedown
Three Up
scan code: 0x7004B key code: pageup
Three Left
scan code: 0x90004 key code: 113
Three Right
scan code: 0x90005 key code: 114
Four Down
scan code: 0x700E3 key code: leftmeta
scan code: 0x70007 key code: d
Four Up
scan code: 0x700E2 key code: leftalt
scan code: 0x7002B key code: tab
Four Right
scan code: 0x700E3 key code: leftmeta
scan code: 0x7004F key code: right
Four Left
scan code: 0x700E3 key code: leftmeta
scan code: 0x70050 key code: left
You can see how Logitech did things each gesture comes out as a keyboard press, the one really cool bonus of the keyboard output is that this device should work without any special drivers. The bad part, no custom gestures (not that I've gotten utouch to work under arch anyway). Next all you need to do is create the keymap for the touchpad, I created a file, /lib/udev/keymaps/logitech-touchpad
0x7004E hiragana #Three Down, screendown
0x7004B kpjpcomma # Three Up, screenup
0x90005 leftmeta #Three Right, Activities
0x90004 back #three Left, Back
0x700E2 leftalt #Four up 1
0x7002B f11 #Four up 2, toggle maximized state
0x700E3 leftalt #Four down 1
0x70007 f7 #Four Down 2, Move window
#0x700E3 First part of four right
#0x7004F second part of four right
#0x700E3 First part of four right
#0x70050 second part of four right
The first two are what I'm already using on my keyboard to switch desktops using xbindkeys. Its really easy to configure and I'm sure could write a little post about it if needed. I'm hoping the rest of the remappings make sense,
Now just use this command to remap the touchpad on the fly, if you are going to use different mappings this is very useful for testing.
sudo /lib/udev/keymap /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse /lib/udev/keymaps/logitech-touchpad
And I have some fun and functional gestures.
The next step is to make a udev rule to load this whenever the device is detected, however I don't intend to restart my computer for a while now so I haven't built the udev rules, I'll follow up with my rule when I make it, otherwise check out the askubuntu.com post. I also hope to post about my fun with the Razer Anasi - the tricks to get it working might also give us clues to unlocking more gestures with the Logitech device.
Can you map right click and middle click on a gesture?
ReplyDeleteHi all. I've just plugged a logitech wireless touchpad on a
ReplyDeleteFedora 17 rig and it's working fine.
It has been recognised immediatly without any intervention.
Even though it is not programmable, default gestures listed on
Logitech's page http://goo.gl/HbCWZ are fine. In order to get the
most of gnome shell, I've mapped 4 finger sweep in the
following manner:
Up -> Alt+Tab
Down -> Super (windows key)
Left -> Workspace Up
Right -> Workspace Down
To do that, fire up dconf-editor and select:
org.gnome.desktop.wm.keybindings
modify parameters as follows
panel-main-menu ['F1','d']
switch to workspace-up [Up,'Left']
switch to workspace-down [Down,'Right']
That's all.