input-remapper icon indicating copy to clipboard operation
input-remapper copied to clipboard

on portuguese keyboard can't remap º to /, but can remap a to b

Open nickyspag opened this issue 3 years ago • 3 comments

I am using Ubuntu 22.04 on Wayland with portuguese keyboard/layout.

I am able to remap a key such as a to b, but if i try same with portuguese character º to / it just ignores me.

If I create 2 such mappings: and press keys output is

It also doesn't work trying to map ISO Level3 Shift + , to /

input-remapper version 1.5.0e31a1b2 python-evdev 1.4.0

Any ideas? Thanks.

nickyspag avatar Jul 27 '22 14:07 nickyspag

I am not familiar with the portuguese keyboard layout, but from searching a few pictures I would think that you need a macro: modify(Shift_L, key(7)) this will press the left shift key and 7 at the same time, just as if you would write / with your normal keyboard. As input you should be able to record whatever you like.

jonasBoss avatar Jul 28 '22 09:07 jonasBoss

Thanks for your help. The modify macro works for the º key. This is going to greatly improve the quality of my life!

However if I try to set mapping for my first choice which was ISO Level3 Shift + , (comma), it gives the character which is the same as pressing Shift_L + ISO Level3 Shift + 7. Why is it behaving as if the ISO Level3 Shift key is down when the mapping is set to modify(Shift_L, key(7)) how do I "clear" the ISO Level3 Shift from the modify(), or am I missing something?

nickyspag avatar Jul 28 '22 10:07 nickyspag

I think your best bet is to use $ sudo evtest (you might need to install it first) and spy on your keyboard to see which events it sends when you write / and then recreate those with inputremapper.

For my german keyboard I get the following:

Testing ... (interrupt to exit)
Event: time 1659265146.151946, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028
Event: time 1659265146.151946, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0
Event: time 1659265146.151946, -------------- SYN_REPORT ------------
Event: time 1659265149.896388, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e1
Event: time 1659265149.896388, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1  <-- pressing Shift-L
Event: time 1659265149.896388, -------------- SYN_REPORT ------------
Event: time 1659265150.146741, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 2
Event: time 1659265150.146741, -------------- SYN_REPORT ------------
Event: time 1659265150.183676, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 2
Event: time 1659265150.183676, -------------- SYN_REPORT ------------
# ignore events with value 2 they get automatically created while holding a key

Event: time 1659265150.183676, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70024
Event: time 1659265150.183676, type 1 (EV_KEY), code 8 (KEY_7), value 1           <-- pressing 7
Event: time 1659265150.183676, -------------- SYN_REPORT ------------
Event: time 1659265150.288437, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70024
Event: time 1659265150.288437, type 1 (EV_KEY), code 8 (KEY_7), value 0           <-- releasing 7
Event: time 1659265150.288437, -------------- SYN_REPORT ------------
Event: time 1659265150.384453, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e1
Event: time 1659265150.384453, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0  <-- releasing Shift-L

From this I can see that I need the following macro: modify(KEY_LEFTSHIFT, key(KEY_7)) important: use the exact keynames recorded by evetest. e.g. KEY_LEFTSHIFT instead of Shift_L. The all Uppercase KEY_xxx or BTN_xxx names should be always working, while the other names are dependent on your language settings and can vary from machine to machine.

jonasBoss avatar Jul 31 '22 11:07 jonasBoss

explained in https://github.com/sezanzeb/input-remapper/blob/main/readme/usage.md#limitations

sezanzeb avatar Nov 12 '22 19:11 sezanzeb