You are not logged in.

#1 2017-02-07 22:47:13

Wishdream
Member
From: Philippines
Registered: 2017-02-07
Posts: 2
Website

Simple Key Remapping - With Problems

Here's the gist, I'm currently trying to remap my own tablet's frame buttons.
There are 8 buttons and they seem to work like keyboard keys than buttons.

The item in question is a Ugee M708/ XP-Pen Star 03/ UC-Logic TABLET 1060N.

So I checked it out and looked at the button maps.
Assuming it would be as easy as remapping my USB keypad to be a macro pad, I would go and attempt to set it up like it.

First I checked xinput test:

key press   37 
key press   50 
key press   21 

Wait a sec, 3 keycodes instead of one? 37 seeming to be CTRL, and 50 seeming to be Shift.
So I double checked.

xev | grep KeyPress -a5:

KeyPress event, serial 38, synthetic NO, window 0x5400002,
    root 0xed, subw 0x0, time 2488331, (99,87), root:(693,393),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x5400002,
    root 0xed, subw 0x0, time 2488331, (99,87), root:(693,393),
    state 0x14, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x5400002,
    root 0xed, subw 0x0, time 2488331, (99,87), root:(693,393),
    state 0x15, keycode 21 (keysym 0x2b, plus), same_screen YES,
    XLookupString gives 1 bytes: (2b) "+"
    XmbLookupString gives 1 bytes: (2b) "+"
    XFilterEvent returns: False

So I thought surely it's a macro right? Then I checked again with:
evtest

Event: time 1486507475.813080, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1486507475.813080, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1486507475.813080, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e1
Event: time 1486507475.813080, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1486507475.813080, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7002e
Event: time 1486507475.813080, type 1 (EV_KEY), code 13 (KEY_EQUAL), value 0

Well, it does seem to be a macro from somewhere. Mind helping me out locating this or help me remap this single button?
I know this isn't a hardware macro since I was able to remap it on Windows just fine.

Any ideas?

P.S. wacom drivers is not fully supported on this device. Meaning no xsetwacom to help out.

Offline

#2 2017-02-09 15:29:53

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Simple Key Remapping - With Problems

Can you use xmodmap?

Andrew

Offline

#3 2017-02-11 22:18:17

seth
Member
Registered: 2012-09-03
Posts: 50,983

Re: Simple Key Remapping - With Problems

What makes you believe it's not a HW provided combo (what's rather common) just because you could "remap it on Windows just fine"?

You can "map" a combo (aka a shortcut) to a single key with eg. xbindkeys and/or any shortcut daemon and eg. invocation of xdotool, ie. you bind ctrl+shift+<plus> to "fake" pressing the plus key or mouse wheel up or whatever; something that might very well have been the behind-the-scenes tech on your successful windows approach.

Offline

#4 2017-02-14 18:27:08

Wishdream
Member
From: Philippines
Registered: 2017-02-07
Posts: 2
Website

Re: Simple Key Remapping - With Problems

fdservices wrote:

Can you use xmodmap?

Andrew

Yes, yes I can.


seth wrote:

What makes you believe it's not a HW provided combo (what's rather common) just because you could "remap it on Windows just fine"?

You can "map" a combo (aka a shortcut) to a single key with eg. xbindkeys and/or any shortcut daemon and eg. invocation of xdotool, ie. you bind ctrl+shift+<plus> to "fake" pressing the plus key or mouse wheel up or whatever; something that might very well have been the behind-the-scenes tech on your successful windows approach.

So you're saying it's an HID related keymap? Something like what HIDmacro does which basically maps the action to a specific USB device making a specific keypress?

Offline

#5 2017-02-14 20:02:54

seth
Member
Registered: 2012-09-03
Posts: 50,983

Re: Simple Key Remapping - With Problems

I'm saying the hardware may actually generate the key series (this is totally common for eg. meta+l, win++/-, win+f etc. - the keyboard provides a special key that simply triggers a common windows shortcut) - that does not men it *could* not be the HID kernel module, though that would be strange.
What I suggest is to accept that condition and bind the shortcut to an input action that fakes a press/release of the desired key.

I don't know which approach you took on windows and frankly couldn't definitively say how that actually works - I just suggested what *might* happen on windows to cover this situation.

Offline

Board footer

Powered by FluxBB