Open ransomts opened 6 years ago
The configuration is correct but unfortunately mouse-12 is not supported yet. The X11 core protocol only has 5 mouse buttons defined (recognized by Emacs as mouse-1 to mouse-5) and maybe other buttons are defined in the X Input extension. I searched the source of Emacs and did not find where other mouse-N are mentioned. Do you have more details on this (like the output of xev)?
I can't find anything in the emacs manual about the extra mouse buttons either, but they've been mentioned in blog posts and such, plus emacs is picking up the different mouse-N
values just fine.
Strange, but xev isn't picking anything up from the tablet buttons, just the repositioning of the cursor. However, when I point evtest
at the proper event:
Input driver version is 1.0.1 Input device ID: bus 0x3 vendor 0x5543 product 0x81 version 0x111 Input device name: "UC-LOGIC ugee-1000L Pad" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 256 (BTN_0) Event code 257 (BTN_1) Event code 258 (BTN_2) Event code 259 (BTN_3) Event code 260 (BTN_4) Event code 261 (BTN_5) Event code 262 (BTN_6) Event code 263 (BTN_7) Event code 264 (BTN_8) Event code 331 (BTN_STYLUS) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 1 Event code 1 (ABS_Y) Value 0 Min 0 Max 1 Event code 40 (ABS_MISC) Value 0 Min 0 Max 1 Event type 4 (EV_MSC) Event code 4 (MSC_SCAN) Properties: Testing ... (interrupt to exit) Event: time 1517762364.987090, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008 Event: time 1517762364.987090, type 1 (EV_KEY), code 263 (BTN_7), value 1 Event: time 1517762364.987090, -------------- SYN_REPORT ------------ Event: time 1517762365.061089, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008 Event: time 1517762365.061089, type 1 (EV_KEY), code 263 (BTN_7), value 0 Event: time 1517762365.061089, -------------- SYN_REPORT ------------ Event: time 1517762365.567082, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90007 Event: time 1517762365.567082, type 1 (EV_KEY), code 262 (BTN_6), value 1 Event: time 1517762365.567082, -------------- SYN_REPORT ------------ Event: time 1517762365.661081, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90007 Event: time 1517762365.661081, type 1 (EV_KEY), code 262 (BTN_6), value 0 Event: time 1517762365.661081, -------------- SYN_REPORT ------------ Event: time 1517762366.045079, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90006 Event: time 1517762366.045079, type 1 (EV_KEY), code 261 (BTN_5), value 1 Event: time 1517762366.045079, -------------- SYN_REPORT ------------ Event: time 1517762366.169082, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90006 Event: time 1517762366.169082, type 1 (EV_KEY), code 261 (BTN_5), value 0 Event: time 1517762366.169082, -------------- SYN_REPORT ------------ Event: time 1517762366.573076, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005 Event: time 1517762366.573076, type 1 (EV_KEY), code 260 (BTN_4), value 1 Event: time 1517762366.573076, -------------- SYN_REPORT ------------ Event: time 1517762366.645075, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005 Event: time 1517762366.645075, type 1 (EV_KEY), code 260 (BTN_4), value 0 Event: time 1517762366.645075, -------------- SYN_REPORT ------------
So the events are being sent but X isn't picking them up I guess?
X seems to recognize the device with the correct event id:
$ xinput list-props 11 Device 'UC-LOGIC ugee-1000L Pad': Device Enabled (141): 1 Coordinate Transformation Matrix (143): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Send Events Modes Available (264): 1, 0 libinput Send Events Mode Enabled (265): 0, 0 libinput Send Events Mode Enabled Default (266): 0, 0 Device Node (267): "/dev/input/event8" Device Product ID (268): 21827, 129
After reading up on the state of drawing tablets drivers, I'm fairly convinced this is a matter of the evdev driver not covering this usecase (and rightly so, how often do drawing tablets send mouse events with id's 8-12). Drivers for these things just aren't there and wizardpen both didn't work for me and was abandoned in 2016.
Here's the workaround I've got going:
(global-set-key (kbd "<mouse-12>") (lambda () (interactive) (exwm-input--fake-key 26)))
Which is in bad form because I pulled the exwm-input--fake-key
out of the ordinary exwm-input-send-next-key
and put in a magic number to boot. It'd be nice if there was some sort of scripting function I could call to shove in these keycodes, but no worries!
Those reported by evtest are low-level codes defined in linux/input-event-codes.h . It's not clear to me how they get interpreted by X11. I still think XELB need to be XInput-aware in order to process those events.
I have a tablet with a few buttons that send mouse signals to emacs, (mouse events 8-12). I can catch the event with an ordinary emacs global-set-key just fine, but I'd like to map them into the simulation keys as well. Here's the relevant part of my config, I've taken out the other mappings since they work great.
Right now it's not picking up in any X window. Is that syntax correct, is this an emacs issue, is this an issue with another package?