[arch-general] Additional mouse (Lenovo N700) gesture binding
I just got the above bluetooth and/or wireless (dual-mode) mouse for my work, as the presenter laser looked pretty useful. 3 basic buttons (1, 2, 3) worked out of the box. So did the touch-scrolling (up/down). So I'm looking for advise for the remaining 3 inputs supported. This mouse has a 'Windows key' button and supports left/right swipe gestures (targeted at the new Windows side-screen gestures). Firstly, regarding the gestures, here's what I obtain from xinput test. I've also listed which keys these correspond to. Left swipe:- key press 22 Backspace key press 133 Super_L (left Windows key) key press 37 Control_L key release 22 Backspace key release 133 Super_L (left Windows key) key release 37 Control_L Right swipe:- key press 54 c key press 133 Super_L (left Windows key) key release 54 c key release 133 Super_L (left Windows key) This seems to correspond to pressing 3/2 key combos and releasing them in the same order. This seems to cause problems with xbindkeys and sxhkd (the only two key-binding daemons I've used before) as using the Super-c combo expects the Windows key to be pressed first, followed by the c key being pressed and released. How can I bind gestures to the above? Is it possible, for example, to bind keys to a specific input device (so for example I can bind to the letter c but only from the mouse, not from my keyboard)? Or something involving xmodmap? Thanks for your advise/help.
On Wed, Apr 22, 2015 at 10:34 AM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:q <snip>
Firstly, regarding the gestures, here's what I obtain from xinput test. I've also listed which keys these correspond to.
Left swipe:- key press 22 Backspace key press 133 Super_L (left Windows key) key press 37 Control_L key release 22 Backspace key release 133 Super_L (left Windows key) key release 37 Control_L
Right swipe:- key press 54 c key press 133 Super_L (left Windows key) key release 54 c key release 133 Super_L (left Windows key) <snip> How can I bind gestures to the above? Is it possible, for example, to bind keys to a specific input device (so for example I can bind to the letter c but only from the mouse, not from my keyboard)? Or something involving xmodmap?
It's been a month, and off and on I've been looking at this more. It appear xkb allows per-device settings, but I've run into several roadblocks. First, I can obtain the current settings using xkbcomp $DISPLAY file.xkb, I then edit it to replace the letter 'c' with the letter 'q'. To test, when I use file.xkb (xkbcomp file.xkb $DISPLAY) this works as expected. Of course, I then reset it to the original behaviour because I don't really want to not be able to type the letter c at all. However, when I try to specify only a specific device (in my case the bluetooth mouse on id 14), this does not seem to change anything. My keyboard works the same (c does not change to q) and the mouse also outputs c rather than q. However after trying to 'type' c on the mouse, my keyboard then outputs q instead of c. This is despite the fact that the keyboard should be id 11. This behaviour sometimes seems to happen the other way as well, a change (c becomes q) in the id 11 keyboard may suddenly affect the mouse, not immediately, but after typing some characters for testing. Does anyone have any idea what could be going on? Could this all just be a limitation of trying to use xkb with a bluetooth mouse?
On May 14, 2015 5:53:22 AM EDT, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
Firstly, regarding the gestures, here's what I obtain from xinput test. I've also listed which keys these correspond to.
Left swipe:- key press 22 Backspace key press 133 Super_L (left Windows key) key press 37 Control_L key release 22 Backspace key release 133 Super_L (left Windows key) key release 37 Control_L
Right swipe:- key press 54 c key press 133 Super_L (left Windows key) key release 54 c key release 133 Super_L (left Windows key) <snip> How can I bind gestures to the above? Is it possible, for example, to bind keys to a specific input device (so for example I can bind to
On Wed, Apr 22, 2015 at 10:34 AM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:q <snip> the
letter c but only from the mouse, not from my keyboard)? Or something involving xmodmap?
It's been a month, and off and on I've been looking at this more. It appear xkb allows per-device settings, but I've run into several roadblocks.
First, I can obtain the current settings using xkbcomp $DISPLAY file.xkb, I then edit it to replace the letter 'c' with the letter 'q'.
To test, when I use file.xkb (xkbcomp file.xkb $DISPLAY) this works as expected. Of course, I then reset it to the original behaviour because I don't really want to not be able to type the letter c at all.
However, when I try to specify only a specific device (in my case the bluetooth mouse on id 14), this does not seem to change anything. My keyboard works the same (c does not change to q) and the mouse also outputs c rather than q. However after trying to 'type' c on the mouse, my keyboard then outputs q instead of c. This is despite the fact that the keyboard should be id 11.
This behaviour sometimes seems to happen the other way as well, a change (c becomes q) in the id 11 keyboard may suddenly affect the mouse, not immediately, but after typing some characters for testing.
Does anyone have any idea what could be going on? Could this all just be a limitation of trying to use xkb with a bluetooth mouse?
I can't help you, but I am very interested in this problem. I have an old gaming mouse with additional buttons I'd like to bind. Perhaps there is a way to do this without the keyboard? There must be a way to define a new button for a mouse. Or perhaps there's a way to do this without X. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
On Thu, May 14, 2015 at 9:22 PM, Christian Demsar <vixsomnis@fastmail.com> wrote:
Does anyone have any idea what could be going on? Could this all just be a limitation of trying to use xkb with a bluetooth mouse?
I can't help you, but I am very interested in this problem. I have an old gaming mouse with additional buttons I'd like to bind.
Perhaps there is a way to do this without the keyboard? There must be a way to define a new button for a mouse. Or perhaps there's a way to do this without X.
Yes there is, but for that to happen the signal received must be a button signal. Your old gaming mouse should work just fine if you follow instructions in [1]. The N700 is a bit of an odd case because the signals its sending out are odd (see my original email). I doubt your gaming mouse does that. [1] - https://wiki.archlinux.org/index.php/All_Mouse_Buttons_Working
On May 15, 2015 11:12:20 AM EDT, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
Does anyone have any idea what could be going on? Could this all just be a limitation of trying to use xkb with a bluetooth mouse?
I can't help you, but I am very interested in this problem. I have an
On Thu, May 14, 2015 at 9:22 PM, Christian Demsar <vixsomnis@fastmail.com> wrote: old gaming mouse with additional buttons I'd like to bind.
Perhaps there is a way to do this without the keyboard? There must be
a way to define a new button for a mouse. Or perhaps there's a way to do this without X.
Yes there is, but for that to happen the signal received must be a button signal. Your old gaming mouse should work just fine if you follow instructions in [1].
The N700 is a bit of an odd case because the signals its sending out are odd (see my original email). I doubt your gaming mouse does that.
[1] - https://wiki.archlinux.org/index.php/All_Mouse_Buttons_Working
Yes, my mouse doesn't actually have that problem, although I thought it did. However, I do have a special key on my laptop that would normally activate a proprietary menu on the factory Windows install. `scankeys` reports it as a series of codes instead of a single code, so I can't reassign it in GNOME. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Anyone have any idea on this? Been months and I've looked into it on and off, but always been frustrated =( On Thu, May 14, 2015 at 5:53 PM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
On Wed, Apr 22, 2015 at 10:34 AM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:q <snip>
Firstly, regarding the gestures, here's what I obtain from xinput test. I've also listed which keys these correspond to.
Left swipe:- key press 22 Backspace key press 133 Super_L (left Windows key) key press 37 Control_L key release 22 Backspace key release 133 Super_L (left Windows key) key release 37 Control_L
Right swipe:- key press 54 c key press 133 Super_L (left Windows key) key release 54 c key release 133 Super_L (left Windows key) <snip> How can I bind gestures to the above? Is it possible, for example, to bind keys to a specific input device (so for example I can bind to the letter c but only from the mouse, not from my keyboard)? Or something involving xmodmap?
It's been a month, and off and on I've been looking at this more. It appear xkb allows per-device settings, but I've run into several roadblocks.
First, I can obtain the current settings using xkbcomp $DISPLAY file.xkb, I then edit it to replace the letter 'c' with the letter 'q'.
To test, when I use file.xkb (xkbcomp file.xkb $DISPLAY) this works as expected. Of course, I then reset it to the original behaviour because I don't really want to not be able to type the letter c at all.
However, when I try to specify only a specific device (in my case the bluetooth mouse on id 14), this does not seem to change anything. My keyboard works the same (c does not change to q) and the mouse also outputs c rather than q. However after trying to 'type' c on the mouse, my keyboard then outputs q instead of c. This is despite the fact that the keyboard should be id 11.
This behaviour sometimes seems to happen the other way as well, a change (c becomes q) in the id 11 keyboard may suddenly affect the mouse, not immediately, but after typing some characters for testing.
Does anyone have any idea what could be going on? Could this all just be a limitation of trying to use xkb with a bluetooth mouse?
On 6 August 2015 at 03:42, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
Anyone have any idea on this? Been months and I've looked into it on and off, but always been frustrated =(
On Thu, May 14, 2015 at 5:53 PM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
On Wed, Apr 22, 2015 at 10:34 AM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:q <snip>
Firstly, regarding the gestures, here's what I obtain from xinput test. I've also listed which keys these correspond to.
https://wiki.archlinux.org/index.php/Map_scancodes_to_keycodes use the hwdb (udev) way. you can set a scancode to reserved to ignore it
Left swipe:- key press 22 Backspace key press 133 Super_L (left Windows key) key press 37 Control_L key release 22 Backspace key release 133 Super_L (left Windows key) key release 37 Control_L
Right swipe:- key press 54 c key press 133 Super_L (left Windows key) key release 54 c key release 133 Super_L (left Windows key)
-- damjan
On Thu, Aug 6, 2015 at 3:52 PM, Damjan Georgievski <gdamjan@gmail.com> wrote:
On 6 August 2015 at 03:42, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
Anyone have any idea on this? Been months and I've looked into it on and off, but always been frustrated =(
On Thu, May 14, 2015 at 5:53 PM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
On Wed, Apr 22, 2015 at 10:34 AM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:q <snip>
Firstly, regarding the gestures, here's what I obtain from xinput test. I've also listed which keys these correspond to.
https://wiki.archlinux.org/index.php/Map_scancodes_to_keycodes use the hwdb (udev) way. you can set a scancode to reserved to ignore it
Thanks, that looks promising. I'll reply again as soon as I've had the chance to try this out.
On Thu, Aug 6, 2015 at 4:52 PM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
On Thu, Aug 6, 2015 at 3:52 PM, Damjan Georgievski <gdamjan@gmail.com> wrote:
https://wiki.archlinux.org/index.php/Map_scancodes_to_keycodes use the hwdb (udev) way. you can set a scancode to reserved to ignore it
Thanks, that looks promising. I'll reply again as soon as I've had the chance to try this out.
A million thanks to Damjan Georgievski who solved my problem! For posterity (and myself when I inevitably google this problem again in a year or so), here's a summary:- evtest on this mouse gives:- left-to-right-swipe -> Backspace, Super_L, Control_L (7002a, 700e3, 700e0 in hex) right-to-left-swipe -> c, Super_L (70006, 700e3 in hex) cat /proc/bus/input/devices gives the following relevant details for bluetooth (above) and dongle-based (below) connections:- I: Bus=0005 Vendor=17ef Product=6060 Version=0001 N: Name="Lenovo Mice N700" P: Phys=DC:85:DE:54:9E:50 I: Bus=0003 Vendor=17ef Product=6060 Version=0111 N: Name="Dual Mode WL Touch Mouse N700" P: Phys=usb-0000:00:14.0-4/input0 This summarizes into the following /etc/udev/hwdb.d/90-LenovoN700.hwdb evdev:input:b0005v17EFp6060e0001* KEYBOARD_KEY_70006=prog1 KEYBOARD_KEY_700e3=reserved KEYBOARD_KEY_7002a=prog2 KEYBOARD_KEY_700e0=reserved evdev:input:b0003v17EFp6060e0111* KEYBOARD_KEY_70006=prog1 KEYBOARD_KEY_700e3=reserved KEYBOARD_KEY_7002a=prog2 KEYBOARD_KEY_700e0=reserved And I can then use xbindkeys or sxhkd to bind XF86Launch1 and XF86Launch2 to whatever I like =)
participants (3)
-
Christian Demsar
-
Damjan Georgievski
-
Oon-Ee Ng