sezanzeb / input-remapper

🎮 ⌨ An easy to use tool to change the behaviour of your input devices.
GNU General Public License v3.0
3.86k stars 161 forks source link

Cyrillic symbols not getting injected #210

Closed Fifis closed 2 years ago

Fifis commented 2 years ago

Using Linux Mint 20.2 (based on Ubuntu 20.04) DE: Cinnamon 5.0.7 Model: MSI GF72-8RD Layouts in use: English (US) + Russian, extra typographic characters enabled, 3rd level = AltGr, switch layour = Alt+Shift

I tried adding some Cyrillic symbols and a tilde to the third level (AltGr + something), and it would not work even after reboot or service restart. Here is the full diagnostic information:

fifis@GF72-8RD:~$ key-mapper-control --version
key-mapper 1.2.1 2803bb841e19232ec08c57bdfca66d0535131dab https://github.com/sezanzeb/key-mapper
python-evdev 1.3.0
fifis@GF72-8RD:~$ echo $XDG_SESSION_TYPE
x11
fifis@GF72-8RD:~$ sudo ls -l /proc/1/exe
lrwxrwxrwx 1 root root 0 Nov 21 22:47 /proc/1/exe -> /usr/lib/systemd/systemd

JSON preset:

{
    "mapping": {
        "1,100,1+1,21,1": "\u0463",
        "1,100,1+1,42,1+1,21,1": "\u0462",
        "1,100,1+1,54,1+1,21,1": "\u0462",
        "1,100,1+1,54,1+1,23,1": "\u0406",
        "1,100,1+1,42,1+1,23,1": "\u0406",
        "1,100,1+1,23,1": "\u0456",
        "1,100,1+1,54,1+1,24,1": "\u0472",
        "1,100,1+1,42,1+1,24,1": "\u0472",
        "1,100,1+1,24,1": "\u0473",
        "1,100,1+1,54,1+1,22,1": "\u0474",
        "1,100,1+1,42,1+1,22,1": "\u0474",
        "1,100,1+1,22,1": "\u0475",
        "1,100,1+1,41,1": "~"
    }
}

Service status had some interesting error lines (these are the letters that I wanted to map):

fifis@GF72-8RD:~$ systemctl status key-mapper
<...>
Nov 21 22:57:13 GF72-8RD key-mapper-service[4995]: ERROR: Don't know what "І" is
Nov 21 22:57:13 GF72-8RD key-mapper-service[4995]: ERROR: Don't know what "і" is
Nov 21 22:57:13 GF72-8RD key-mapper-service[4995]: ERROR: Don't know what "Ѳ" is
Nov 21 22:57:13 GF72-8RD key-mapper-service[4995]: ERROR: Don't know what "Ѳ" is
Nov 21 22:57:13 GF72-8RD key-mapper-service[4995]: ERROR: Don't know what "ѳ" is
Nov 21 22:57:13 GF72-8RD key-mapper-service[4995]: ERROR: Don't know what "Ѵ" is
Nov 21 22:57:13 GF72-8RD key-mapper-service[4995]: ERROR: Don't know what "Ѵ" is
Nov 21 22:57:13 GF72-8RD key-mapper-service[4995]: ERROR: Don't know what "ѵ" is
Nov 21 22:57:13 GF72-8RD key-mapper-service[4995]: ERROR: Don't know what "~" is
<...>

Debug log:

fifis@GF72-8RD:~$ sudo pkill -f key-mapper-service && key-mapper-gtk -d
6089 0.07018 INFO logger.py:163: key-mapper-gtk 1.2.1 2803bb841e19232ec08c57bdfca66d0535131dab https://github.com/sezanzeb/key-mapper
6089 0.07034 INFO logger.py:168: python-evdev 1.3.0
6089 0.07037 WARNING logger.py:171: Debug level will log all your keystrokes! Do not post this output in the internet if you typed in sensitive or private information with your device!
6089 0.07040 DEBUG key-mapper-gtk:65: Using locale directory: /usr/share/key-mapper/lang
6089 0.09152 DEBUG system_mapping.py:64: Gathering available keycodes
6089 0.09513 DEBUG system_mapping.py:86: Writing "/home/fifis/.config/key-mapper/xmodmap.json"
6089 0.10130 DEBUG groups.py:335: Discovering device paths
6089 0.10191 DEBUG groups.py:435: Did not find any input device
6089 0.10296 SPAM pipe.py:62: Creating new pipe for "/tmp/key-mapper-fifis/results"
6089 0.10325 SPAM pipe.py:62: Creating new pipe for "/tmp/key-mapper-fifis/commands"
6089 0.11216 SPAM shared_dict.py:58: Starting SharedDict process
6098 0.11388 SPAM shared_dict.py:64: SharedDict process started
6089 0.11987 INFO config.py:248: Loaded config from "/home/fifis/.config/key-mapper/config.json"
6089 0.12171 INFO daemon.py:175: Starting the service
6089 0.12176 DEBUG daemon.py:186: Running `pkexec key-mapper-control --command start-daemon  -d`
6100 0.00553 DEBUG key-mapper-control:237: Call for "['/usr/bin/key-mapper-control', '--command', 'start-daemon', '-d']"
6114 0.04160 DEBUG groups.py:335: Discovering device paths
6089 2.53644 DEBUG daemon.py:196: Attempt 1 to connect to the service failed: "g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name keymapper.Control was not provided by any .service files (2)"
6114 0.22713 SPAM groups.py:367: Found "25_0_0_wmi", "/dev/input/event8", "MSI WMI hotkeys", type: unknown
6114 0.24639 SPAM groups.py:367: Found "17_2_7_isa0060", "/dev/input/event7", "SynPS/2 Synaptics TouchPad", type: touchpad
6114 0.27038 SPAM groups.py:367: Found "25_0_6_LNXVIDEO", "/dev/input/event6", "Video Bus", type: unknown
6114 0.30243 SPAM groups.py:367: Found "25_0_6_LNXVIDEO", "/dev/input/event5", "Video Bus", type: unknown
6089 2.73838 DEBUG daemon.py:196: Attempt 2 to connect to the service failed: "g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name keymapper.Control was not provided by any .service files (2)"
6114 0.31866 SPAM groups.py:367: Found "17_1_1_isa0060", "/dev/input/event4", "AT Translated Set 2 keyboard", type: keyboard
6114 0.39040 SPAM groups.py:367: Found "25_0_3_PNP0C0E", "/dev/input/event1", "Sleep Button", type: unknown
6114 0.41550 INFO groups.py:438: Found "MSI WMI hotkeys", "SynPS/2 Synaptics TouchPad", "Video Bus", "AT Translated Set 2 keyboard", "Sleep Button"
6114 0.42230 DEBUG system_mapping.py:64: Gathering available keycodes
6114 0.43341 DEBUG system_mapping.py:86: Writing "/home/fifis/.config/key-mapper/xmodmap.json"
6114 0.43906 SPAM shared_dict.py:58: Starting SharedDict process
6120 0.44435 SPAM shared_dict.py:64: SharedDict process started
6114 0.44942 INFO logger.py:203: This output is also stored in "/var/log/key-mapper"
6114 0.45044 INFO logger.py:219: Logging to "/var/log/key-mapper"
6114 0.45061 DEBUG daemon.py:147: Creating daemon
6114 0.46226 DEBUG daemon.py:220: Running daemon
6089 2.94377 DEBUG window.py:236: Running `pkexec key-mapper-control --command helper  -d`
6124 0.00547 DEBUG key-mapper-control:237: Call for "['/usr/bin/key-mapper-control', '--command', 'helper', '-d']"
6089 5.70938 DEBUG presets.py:156: None of the configured devices is currently online
6131 0.03620 DEBUG groups.py:335: Discovering device paths
6131 0.22623 SPAM groups.py:367: Found "25_0_0_wmi", "/dev/input/event8", "MSI WMI hotkeys", type: unknown
6131 0.24951 SPAM groups.py:367: Found "17_2_7_isa0060", "/dev/input/event7", "SynPS/2 Synaptics TouchPad", type: touchpad
6131 0.27355 SPAM groups.py:367: Found "25_0_6_LNXVIDEO", "/dev/input/event6", "Video Bus", type: unknown
6131 0.30144 SPAM groups.py:367: Found "25_0_6_LNXVIDEO", "/dev/input/event5", "Video Bus", type: unknown
6131 0.32169 SPAM groups.py:367: Found "17_1_1_isa0060", "/dev/input/event4", "AT Translated Set 2 keyboard", type: keyboard
6131 0.39346 SPAM groups.py:367: Found "25_0_3_PNP0C0E", "/dev/input/event1", "Sleep Button", type: unknown
6131 0.43846 INFO groups.py:438: Found "MSI WMI hotkeys", "SynPS/2 Synaptics TouchPad", "Video Bus", "AT Translated Set 2 keyboard", "Sleep Button"
6131 0.44048 SPAM pipe.py:79: Using existing pipe for "/tmp/key-mapper-fifis/results"
6131 0.44123 SPAM pipe.py:79: Using existing pipe for "/tmp/key-mapper-fifis/commands"
6089 6.15309 DEBUG reader.py:94: Received 5 devices
6089 6.15553 DEBUG presets.py:160: The newest preset is "AT Translated Set 2 keyboard", "Prerevolutionary"
6089 6.15595 DEBUG window.py:657: Selecting device "AT Translated Set 2 keyboard"
6089 6.15635 DEBUG window.py:403: "AT Translated Set 2 keyboard" presets: "Prerevolutionary"
6089 6.15806 DEBUG window.py:757: Selecting preset "Prerevolutionary"
6089 6.15828 INFO mapping.py:166: Loading preset from "/home/fifis/.config/key-mapper/presets/AT Translated Set 2 keyboard/Prerevolutionary.json"
6089 6.15877 SPAM mapping.py:201: Key((1, 100, 1), (1, 21, 1)) maps to ѣ
6089 6.15900 SPAM mapping.py:201: Key((1, 100, 1), (1, 42, 1), (1, 21, 1)) maps to Ѣ
6089 6.15917 SPAM mapping.py:201: Key((1, 100, 1), (1, 54, 1), (1, 21, 1)) maps to Ѣ
6089 6.15933 SPAM mapping.py:201: Key((1, 100, 1), (1, 54, 1), (1, 23, 1)) maps to І
6089 6.15948 SPAM mapping.py:201: Key((1, 100, 1), (1, 42, 1), (1, 23, 1)) maps to І
6089 6.15962 SPAM mapping.py:201: Key((1, 100, 1), (1, 23, 1)) maps to і
6089 6.15979 SPAM mapping.py:201: Key((1, 100, 1), (1, 54, 1), (1, 24, 1)) maps to Ѳ
6089 6.15994 SPAM mapping.py:201: Key((1, 100, 1), (1, 42, 1), (1, 24, 1)) maps to Ѳ
6089 6.16009 SPAM mapping.py:201: Key((1, 100, 1), (1, 24, 1)) maps to ѳ
6089 6.16028 SPAM mapping.py:201: Key((1, 100, 1), (1, 54, 1), (1, 22, 1)) maps to Ѵ
6089 6.16045 SPAM mapping.py:201: Key((1, 100, 1), (1, 42, 1), (1, 22, 1)) maps to Ѵ
6089 6.16059 SPAM mapping.py:201: Key((1, 100, 1), (1, 22, 1)) maps to ѵ
6089 6.16075 SPAM mapping.py:201: Key((1, 100, 1), (1, 41, 1)) maps to ~
6089 6.21548 DEBUG reader.py:189: Sending start msg to helper for "AT Translated Set 2 keyboard"
6089 6.21557 DEBUG reader.py:205: Clearing reader
6131 0.51649 DEBUG helper.py:100: Received command "AT Translated Set 2 keyboard"
6131 0.51663 DEBUG helper.py:155: Starting reading keycodes from "AT Translated Set 2 keyboard"
6089 7.23369 SPAM reader.py:161: (1, 56, 1) -------------------- down
6089 7.23379 SPAM reader.py:181: ((1, 56, 1)) ------------------ read result
6089 7.90532 SPAM reader.py:161: (1, 15, 1) -------------------- down
6089 7.90560 SPAM reader.py:181: ((1, 56, 1), (1, 15, 1)) ------ read result
6089 8.04088 SPAM reader.py:146: (1, 15, 0) -------------------- release
6089 8.07457 SPAM reader.py:146: (1, 56, 0) -------------------- release
6089 10.0869 SPAM reader.py:161: (1, 100, 1) ------------------- down
6089 10.0874 SPAM reader.py:181: ((1, 100, 1)) ----------------- read result
¥6089 10.3219 SPAM reader.py:161: (1, 21, 1) -------------------- down
6089 10.3225 SPAM reader.py:181: ((1, 100, 1), (1, 21, 1)) ----- read result
6089 10.4224 SPAM reader.py:146: (1, 21, 0) -------------------- release
6089 10.7239 SPAM reader.py:146: (1, 100, 0) ------------------- release
6089 13.9139 SPAM reader.py:161: (1, 100, 1) ------------------- down
6089 13.9143 SPAM reader.py:181: ((1, 100, 1)) ----------------- read result
₴6089 14.0808 SPAM reader.py:161: (1, 22, 1) -------------------- down
6089 14.0812 SPAM reader.py:181: ((1, 100, 1), (1, 22, 1)) ----- read result
6089 14.1805 SPAM reader.py:146: (1, 22, 0) -------------------- release
6089 14.3156 SPAM reader.py:146: (1, 100, 0) ------------------- release
6089 14.8864 SPAM reader.py:161: (1, 100, 1) ------------------- down
6089 14.8868 SPAM reader.py:181: ((1, 100, 1)) ----------------- read result
i6089 15.0547 SPAM reader.py:161: (1, 23, 1) -------------------- down
6089 15.0550 SPAM reader.py:181: ((1, 100, 1), (1, 23, 1)) ----- read result
6089 15.1216 SPAM reader.py:146: (1, 23, 0) -------------------- release
6089 15.2562 SPAM reader.py:146: (1, 100, 0) ------------------- release
6089 16.0623 SPAM reader.py:161: (1, 100, 1) ------------------- down
6089 16.0626 SPAM reader.py:181: ((1, 100, 1)) ----------------- read result
o6089 16.2299 SPAM reader.py:161: (1, 24, 1) -------------------- down
6089 16.2303 SPAM reader.py:181: ((1, 100, 1), (1, 24, 1)) ----- read result
6089 16.2968 SPAM reader.py:146: (1, 24, 0) -------------------- release
6089 16.4650 SPAM reader.py:146: (1, 100, 0) ------------------- release
6089 42.9183 SPAM reader.py:161: (1, 28, 1) -------------------- down
6089 42.9184 SPAM reader.py:181: ((1, 28, 1)) ------------------ read result
6089 42.9854 SPAM reader.py:146: (1, 28, 0) -------------------- release
6089 43.7905 SPAM reader.py:161: (1, 42, 1) -------------------- down
6089 43.7910 SPAM reader.py:181: ((1, 42, 1)) ------------------ read result
6089 43.9239 SPAM reader.py:161: (1, 3, 1) --------------------- down
6089 43.9244 SPAM reader.py:181: ((1, 42, 1), (1, 3, 1)) ------- read result
6089 43.9915 SPAM reader.py:146: (1, 42, 0) -------------------- release
6089 43.9918 SPAM reader.py:146: (1, 3, 0) --------------------- release
fifis@GF72-8RD:~$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:  Lid Switch
/dev/input/event1:  Sleep Button
/dev/input/event2:  Power Button
/dev/input/event3:  Power Button
/dev/input/event4:  AT Translated Set 2 keyboard
/dev/input/event5:  Video Bus
/dev/input/event6:  Video Bus
/dev/input/event7:  SynPS/2 Synaptics TouchPad
/dev/input/event8:  MSI WMI hotkeys
/dev/input/event9:  HDA Intel PCH Mic
/dev/input/event10: HDA Intel PCH Headphone
/dev/input/event11: HDA Intel PCH HDMI/DP,pcm=3
/dev/input/event12: HDA Intel PCH HDMI/DP,pcm=7
/dev/input/event13: HDA Intel PCH HDMI/DP,pcm=8
/dev/input/event14: HDA Intel PCH HDMI/DP,pcm=9
/dev/input/event15: HDA Intel PCH HDMI/DP,pcm=10
Select the device event number [0-15]: 4
Input driver version is 1.0.1
Input device ID: bus 0x11 vendor 0x1 product 0x1 version 0xab41
Input device name: "AT Translated Set 2 keyboard"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 2 (KEY_1)
    Event code 3 (KEY_2)
    Event code 4 (KEY_3)
    Event code 5 (KEY_4)
    Event code 6 (KEY_5)
    Event code 7 (KEY_6)
    Event code 8 (KEY_7)
    Event code 9 (KEY_8)
    Event code 10 (KEY_9)
    Event code 11 (KEY_0)
    Event code 12 (KEY_MINUS)
    Event code 13 (KEY_EQUAL)
    Event code 14 (KEY_BACKSPACE)
    Event code 15 (KEY_TAB)
    Event code 16 (KEY_Q)
    Event code 17 (KEY_W)
    Event code 18 (KEY_E)
    Event code 19 (KEY_R)
    Event code 20 (KEY_T)
    Event code 21 (KEY_Y)
    Event code 22 (KEY_U)
    Event code 23 (KEY_I)
    Event code 24 (KEY_O)
    Event code 25 (KEY_P)
    Event code 26 (KEY_LEFTBRACE)
    Event code 27 (KEY_RIGHTBRACE)
    Event code 28 (KEY_ENTER)
    Event code 29 (KEY_LEFTCTRL)
    Event code 30 (KEY_A)
    Event code 31 (KEY_S)
    Event code 32 (KEY_D)
    Event code 33 (KEY_F)
    Event code 34 (KEY_G)
    Event code 35 (KEY_H)
    Event code 36 (KEY_J)
    Event code 37 (KEY_K)
    Event code 38 (KEY_L)
    Event code 39 (KEY_SEMICOLON)
    Event code 40 (KEY_APOSTROPHE)
    Event code 41 (KEY_GRAVE)
    Event code 42 (KEY_LEFTSHIFT)
    Event code 43 (KEY_BACKSLASH)
    Event code 44 (KEY_Z)
    Event code 45 (KEY_X)
    Event code 46 (KEY_C)
    Event code 47 (KEY_V)
    Event code 48 (KEY_B)
    Event code 49 (KEY_N)
    Event code 50 (KEY_M)
    Event code 51 (KEY_COMMA)
    Event code 52 (KEY_DOT)
    Event code 53 (KEY_SLASH)
    Event code 54 (KEY_RIGHTSHIFT)
    Event code 55 (KEY_KPASTERISK)
    Event code 56 (KEY_LEFTALT)
    Event code 57 (KEY_SPACE)
    Event code 58 (KEY_CAPSLOCK)
    Event code 59 (KEY_F1)
    Event code 60 (KEY_F2)
    Event code 61 (KEY_F3)
    Event code 62 (KEY_F4)
    Event code 63 (KEY_F5)
    Event code 64 (KEY_F6)
    Event code 65 (KEY_F7)
    Event code 66 (KEY_F8)
    Event code 67 (KEY_F9)
    Event code 68 (KEY_F10)
    Event code 69 (KEY_NUMLOCK)
    Event code 70 (KEY_SCROLLLOCK)
    Event code 71 (KEY_KP7)
    Event code 72 (KEY_KP8)
    Event code 73 (KEY_KP9)
    Event code 74 (KEY_KPMINUS)
    Event code 75 (KEY_KP4)
    Event code 76 (KEY_KP5)
    Event code 77 (KEY_KP6)
    Event code 78 (KEY_KPPLUS)
    Event code 79 (KEY_KP1)
    Event code 80 (KEY_KP2)
    Event code 81 (KEY_KP3)
    Event code 82 (KEY_KP0)
    Event code 83 (KEY_KPDOT)
    Event code 85 (KEY_ZENKAKUHANKAKU)
    Event code 86 (KEY_102ND)
    Event code 87 (KEY_F11)
    Event code 88 (KEY_F12)
    Event code 89 (KEY_RO)
    Event code 90 (KEY_KATAKANA)
    Event code 91 (KEY_HIRAGANA)
    Event code 92 (KEY_HENKAN)
    Event code 93 (KEY_KATAKANAHIRAGANA)
    Event code 94 (KEY_MUHENKAN)
    Event code 95 (KEY_KPJPCOMMA)
    Event code 96 (KEY_KPENTER)
    Event code 97 (KEY_RIGHTCTRL)
    Event code 98 (KEY_KPSLASH)
    Event code 99 (KEY_SYSRQ)
    Event code 100 (KEY_RIGHTALT)
    Event code 102 (KEY_HOME)
    Event code 103 (KEY_UP)
    Event code 104 (KEY_PAGEUP)
    Event code 105 (KEY_LEFT)
    Event code 106 (KEY_RIGHT)
    Event code 107 (KEY_END)
    Event code 108 (KEY_DOWN)
    Event code 109 (KEY_PAGEDOWN)
    Event code 110 (KEY_INSERT)
    Event code 111 (KEY_DELETE)
    Event code 112 (KEY_MACRO)
    Event code 113 (KEY_MUTE)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 116 (KEY_POWER)
    Event code 117 (KEY_KPEQUAL)
    Event code 118 (KEY_KPPLUSMINUS)
    Event code 119 (KEY_PAUSE)
    Event code 121 (KEY_KPCOMMA)
    Event code 122 (KEY_HANGUEL)
    Event code 123 (KEY_HANJA)
    Event code 124 (KEY_YEN)
    Event code 125 (KEY_LEFTMETA)
    Event code 126 (KEY_RIGHTMETA)
    Event code 127 (KEY_COMPOSE)
    Event code 128 (KEY_STOP)
    Event code 140 (KEY_CALC)
    Event code 142 (KEY_SLEEP)
    Event code 143 (KEY_WAKEUP)
    Event code 150 (KEY_WWW)
    Event code 156 (KEY_BOOKMARKS)
    Event code 157 (KEY_COMPUTER)
    Event code 158 (KEY_BACK)
    Event code 159 (KEY_FORWARD)
    Event code 161 (KEY_EJECTCD)
    Event code 163 (KEY_NEXTSONG)
    Event code 164 (KEY_PLAYPAUSE)
    Event code 165 (KEY_PREVIOUSSONG)
    Event code 166 (KEY_STOPCD)
    Event code 173 (KEY_REFRESH)
    Event code 183 (KEY_F13)
    Event code 184 (KEY_F14)
    Event code 185 (KEY_F15)
    Event code 191 (KEY_F21)
    Event code 212 (KEY_CAMERA)
    Event code 215 (KEY_EMAIL)
    Event code 217 (KEY_SEARCH)
    Event code 224 (KEY_BRIGHTNESSDOWN)
    Event code 225 (KEY_BRIGHTNESSUP)
    Event code 226 (KEY_MEDIA)
    Event code 237 (KEY_BLUETOOTH)
    Event code 238 (KEY_WLAN)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 17 (EV_LED)
    Event code 0 (LED_NUML) state 0
    Event code 1 (LED_CAPSL) state 0
    Event code 2 (LED_SCROLLL) state 0
Key repeat handling:
  Repeat type 20 (EV_REP)
    Repeat code 0 (REP_DELAY)
      Value    250
    Repeat code 1 (REP_PERIOD)
      Value     33
Properties:
Testing ... (interrupt to exit)
Event: time 1637532467.395778, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1c
Event: time 1637532467.395778, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0
Event: time 1637532467.395778, -------------- SYN_REPORT ------------
Event: time 1637532475.993961, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0
Event: time 1637532475.993961, type 1 (EV_KEY), code 108 (KEY_DOWN), value 1
Event: time 1637532475.993961, -------------- SYN_REPORT ------------
Event: time 1637532476.060312, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0
Event: time 1637532476.060312, type 1 (EV_KEY), code 108 (KEY_DOWN), value 0
Event: time 1637532476.060312, -------------- SYN_REPORT ------------
Event: time 1637532476.182448, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0
Event: time 1637532476.182448, type 1 (EV_KEY), code 108 (KEY_DOWN), value 1
Event: time 1637532476.182448, -------------- SYN_REPORT ------------
Event: time 1637532476.248949, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0
Event: time 1637532476.248949, type 1 (EV_KEY), code 108 (KEY_DOWN), value 0
Event: time 1637532476.248949, -------------- SYN_REPORT ------------
Event: time 1637532477.079410, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532477.079410, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
Event: time 1637532477.079410, -------------- SYN_REPORT ------------
Event: time 1637532477.336170, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532477.336170, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 2
Event: time 1637532477.336170, -------------- SYN_REPORT ------------
Event: time 1637532477.367964, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532477.367964, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 2
Event: time 1637532477.367964, -------------- SYN_REPORT ------------
Event: time 1637532477.401187, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532477.401187, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 2
Event: time 1637532477.401187, -------------- SYN_REPORT ------------
Event: time 1637532477.408754, type 4 (EV_MSC), code 4 (MSC_SCAN), value 15
Event: time 1637532477.408754, type 1 (EV_KEY), code 21 (KEY_Y), value 1
Event: time 1637532477.408754, -------------- SYN_REPORT ------------
Event: time 1637532477.542632, type 4 (EV_MSC), code 4 (MSC_SCAN), value 15
Event: time 1637532477.542632, type 1 (EV_KEY), code 21 (KEY_Y), value 0
Event: time 1637532477.542632, -------------- SYN_REPORT ------------
Event: time 1637532477.634060, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532477.634060, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 0
Event: time 1637532477.634060, -------------- SYN_REPORT ------------
Event: time 1637532477.922134, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532477.922134, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
Event: time 1637532477.922134, -------------- SYN_REPORT ------------
Event: time 1637532478.075013, type 4 (EV_MSC), code 4 (MSC_SCAN), value 16
Event: time 1637532478.075013, type 1 (EV_KEY), code 22 (KEY_U), value 1
Event: time 1637532478.075013, -------------- SYN_REPORT ------------
Event: time 1637532478.184167, type 4 (EV_MSC), code 4 (MSC_SCAN), value 16
Event: time 1637532478.184167, type 1 (EV_KEY), code 22 (KEY_U), value 0
Event: time 1637532478.184167, -------------- SYN_REPORT ------------
Event: time 1637532478.318254, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532478.318254, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 0
Event: time 1637532478.318254, -------------- SYN_REPORT ------------
Event: time 1637532478.499099, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532478.499099, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
Event: time 1637532478.499099, -------------- SYN_REPORT ------------
Event: time 1637532478.631864, type 4 (EV_MSC), code 4 (MSC_SCAN), value 17
Event: time 1637532478.631864, type 1 (EV_KEY), code 23 (KEY_I), value 1
Event: time 1637532478.631864, -------------- SYN_REPORT ------------
Event: time 1637532478.745565, type 4 (EV_MSC), code 4 (MSC_SCAN), value 17
Event: time 1637532478.745565, type 1 (EV_KEY), code 23 (KEY_I), value 0
Event: time 1637532478.745565, -------------- SYN_REPORT ------------
Event: time 1637532478.879304, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532478.879304, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 0
Event: time 1637532478.879304, -------------- SYN_REPORT ------------
Event: time 1637532479.042573, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532479.042573, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
Event: time 1637532479.042573, -------------- SYN_REPORT ------------
Event: time 1637532479.195020, type 4 (EV_MSC), code 4 (MSC_SCAN), value 18
Event: time 1637532479.195020, type 1 (EV_KEY), code 24 (KEY_O), value 1
Event: time 1637532479.195020, -------------- SYN_REPORT ------------
Event: time 1637532479.285355, type 4 (EV_MSC), code 4 (MSC_SCAN), value 18
Event: time 1637532479.285355, type 1 (EV_KEY), code 24 (KEY_O), value 0
Event: time 1637532479.285355, -------------- SYN_REPORT ------------
Event: time 1637532479.395608, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532479.395608, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 0
Event: time 1637532479.395608, -------------- SYN_REPORT ------------
Event: time 1637532479.823770, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532479.823770, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
Event: time 1637532479.823770, -------------- SYN_REPORT ------------
Event: time 1637532479.957083, type 4 (EV_MSC), code 4 (MSC_SCAN), value 36
Event: time 1637532479.957083, type 1 (EV_KEY), code 54 (KEY_RIGHTSHIFT), value 1
Event: time 1637532479.957083, -------------- SYN_REPORT ------------
Event: time 1637532480.156694, type 4 (EV_MSC), code 4 (MSC_SCAN), value 15
Event: time 1637532480.156694, type 1 (EV_KEY), code 21 (KEY_Y), value 1
Event: time 1637532480.156694, -------------- SYN_REPORT ------------
Event: time 1637532480.271803, type 4 (EV_MSC), code 4 (MSC_SCAN), value 15
Event: time 1637532480.271803, type 1 (EV_KEY), code 21 (KEY_Y), value 0
Event: time 1637532480.271803, -------------- SYN_REPORT ------------
Event: time 1637532480.381027, type 4 (EV_MSC), code 4 (MSC_SCAN), value 36
Event: time 1637532480.381027, type 1 (EV_KEY), code 54 (KEY_RIGHTSHIFT), value 0
Event: time 1637532480.381027, -------------- SYN_REPORT ------------
Event: time 1637532480.404081, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532480.404081, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 0
Event: time 1637532480.404081, -------------- SYN_REPORT ------------
Event: time 1637532480.558354, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532480.558354, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
Event: time 1637532480.558354, -------------- SYN_REPORT ------------
Event: time 1637532480.644843, type 4 (EV_MSC), code 4 (MSC_SCAN), value 36
Event: time 1637532480.644843, type 1 (EV_KEY), code 54 (KEY_RIGHTSHIFT), value 1
Event: time 1637532480.644843, -------------- SYN_REPORT ------------
Event: time 1637532480.779123, type 4 (EV_MSC), code 4 (MSC_SCAN), value 16
Event: time 1637532480.779123, type 1 (EV_KEY), code 22 (KEY_U), value 1
Event: time 1637532480.779123, -------------- SYN_REPORT ------------
Event: time 1637532480.892322, type 4 (EV_MSC), code 4 (MSC_SCAN), value 16
Event: time 1637532480.892322, type 1 (EV_KEY), code 22 (KEY_U), value 0
Event: time 1637532480.892322, -------------- SYN_REPORT ------------
Event: time 1637532480.914101, type 4 (EV_MSC), code 4 (MSC_SCAN), value 36
Event: time 1637532480.914101, type 1 (EV_KEY), code 54 (KEY_RIGHTSHIFT), value 0
Event: time 1637532480.914101, -------------- SYN_REPORT ------------
Event: time 1637532480.981544, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532480.981544, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 0
Event: time 1637532480.981544, -------------- SYN_REPORT ------------
Event: time 1637532481.117109, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532481.117109, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
Event: time 1637532481.117109, -------------- SYN_REPORT ------------
Event: time 1637532481.183934, type 4 (EV_MSC), code 4 (MSC_SCAN), value 36
Event: time 1637532481.183934, type 1 (EV_KEY), code 54 (KEY_RIGHTSHIFT), value 1
Event: time 1637532481.183934, -------------- SYN_REPORT ------------
Event: time 1637532481.293966, type 4 (EV_MSC), code 4 (MSC_SCAN), value 17
Event: time 1637532481.293966, type 1 (EV_KEY), code 23 (KEY_I), value 1
Event: time 1637532481.293966, -------------- SYN_REPORT ------------
Event: time 1637532481.386335, type 4 (EV_MSC), code 4 (MSC_SCAN), value 17
Event: time 1637532481.386335, type 1 (EV_KEY), code 23 (KEY_I), value 0
Event: time 1637532481.386335, -------------- SYN_REPORT ------------
Event: time 1637532481.431091, type 4 (EV_MSC), code 4 (MSC_SCAN), value 36
Event: time 1637532481.431091, type 1 (EV_KEY), code 54 (KEY_RIGHTSHIFT), value 0
Event: time 1637532481.431091, -------------- SYN_REPORT ------------
Event: time 1637532481.477173, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532481.477173, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 0
Event: time 1637532481.477173, -------------- SYN_REPORT ------------
Event: time 1637532481.618674, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532481.618674, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
Event: time 1637532481.618674, -------------- SYN_REPORT ------------
Event: time 1637532481.662793, type 4 (EV_MSC), code 4 (MSC_SCAN), value 36
Event: time 1637532481.662793, type 1 (EV_KEY), code 54 (KEY_RIGHTSHIFT), value 1
Event: time 1637532481.662793, -------------- SYN_REPORT ------------
Event: time 1637532481.822519, type 4 (EV_MSC), code 4 (MSC_SCAN), value 18
Event: time 1637532481.822519, type 1 (EV_KEY), code 24 (KEY_O), value 1
Event: time 1637532481.822519, -------------- SYN_REPORT ------------
Event: time 1637532481.910840, type 4 (EV_MSC), code 4 (MSC_SCAN), value 18
Event: time 1637532481.910840, type 1 (EV_KEY), code 24 (KEY_O), value 0
Event: time 1637532481.910840, -------------- SYN_REPORT ------------
Event: time 1637532481.953901, type 4 (EV_MSC), code 4 (MSC_SCAN), value 36
Event: time 1637532481.953901, type 1 (EV_KEY), code 54 (KEY_RIGHTSHIFT), value 0
Event: time 1637532481.953901, -------------- SYN_REPORT ------------
Event: time 1637532481.998798, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1637532481.998798, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 0
Event: time 1637532481.998798, -------------- SYN_REPORT ------------
Event: time 1637532486.303572, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1637532486.303572, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1637532486.303572, -------------- SYN_REPORT ------------
Event: time 1637532486.508231, type 4 (EV_MSC), code 4 (MSC_SCAN), value 2c
Event: time 1637532486.508231, type 1 (EV_KEY), code 44 (KEY_Z), value 1
Event: time 1637532486.508231, -------------- SYN_REPORT ------------
^Z
[3]+  Stopped                 sudo evtest
sezanzeb commented 2 years ago

Hi, is this possibly related the problem described here: https://github.com/sezanzeb/key-mapper/blob/main/readme/usage.md#key-names-and-macros?

For example, mapping a key to an exclamation mark is not possible if the keyboard layout is set to german. However, it is possible to mimic the combination that would be required to write it, by writing Shift_L + 1

This might also be interesting, there is an example on how to inject ヤ: https://github.com/sezanzeb/key-mapper/blob/main/readme/examples.md#emitting-unavailable-symbols

Fifis commented 2 years ago

Thank you for your prompt reply! I am completely new to this, so, in fact, the key names on my keyboard are slightly different (although the system locale being en_GB.UTF-8 and the layouts being en_US and ru_RU, and this is what I got with en_US active):

fifis@GF72-8RD:~$ key-mapper-control --symbol-names
Escape
1
<...>
Tab
Cyrillic_shorti
Cyrillic_tse
Cyrillic_u
Cyrillic_ka
Cyrillic_ie
Cyrillic_en
Cyrillic_ghe
Cyrillic_sha
Cyrillic_shcha
Cyrillic_ze
Cyrillic_ha
Cyrillic_hardsign
Return
Control_L
Cyrillic_ef
Cyrillic_yeru
Cyrillic_ve
Cyrillic_a
Cyrillic_pe
Cyrillic_er
Cyrillic_o
Cyrillic_el
Cyrillic_de
Cyrillic_zhe
Cyrillic_e
Cyrillic_io
Shift_L
backslash
Cyrillic_ya
Cyrillic_che
Cyrillic_es
Cyrillic_em
Cyrillic_i
Cyrillic_te
Cyrillic_softsign
Cyrillic_be
Cyrillic_yu
period
Shift_R
KP_Multiply
Alt_L
space
Caps_Lock
F1
<...>

I cannot process the tip ‘Map Shift_L + 1’ for German. Could you please provide a quick example? Do I need to edit JSON? Here is what I am trying to achieve:

The key in question is y (in US English) / н (in Russian). First level, no modifiers. The corresponding name of the symbol in the list above is Cyrillic_en. My 3rd-level key is AltGr. I want AltGr + that key (y / н / Cyrillic_en) to produce the symbol ѣ. What should I edit?

sezanzeb commented 2 years ago

Try

image


about Shift_L + 1: This is a special syntax that can be used. See https://github.com/sezanzeb/key-mapper/blob/main/readme/usage.md#writing-combinations

Fifis commented 2 years ago

I did it, but there are two issues. 1, When I press AltGr + ShiftL + z, the ‘Key’ column says ISO Level3 Shift + Shift L + Cyrillic ya. It happens in both en_US and ru_RU layouts, so no matter what I press, I cannot achieve ISO Level3 Shift + Shift L + z. The mapping is Cyrillic_en.

  1. The problem is, if the en_US layout is selected, AltGr + ShiftL + z produces Y, and it ru_RU is seleted, it produced H (the capital Cyrillic en—don’t be confused by the appearance, it truly is U+041D, although I was expecting its lowercase equivalent, U+043D).
  2. When I try to change the mapping Cyrillic_en for ѣ, the status bar says that it is not recognised (see below). The name for the symbol ѣ (U+0463) is Cyrillic Small Letter Yat, but when I start typing Cyrillic... into the Mapping column, it won’t auto-suggest the name of this Unicode symbol that I want to use.

image

Fifis commented 2 years ago

Also, I tried the k() from the examples, making it "1,100,1+1,21,1": "k(\u0463)", but it won’t work either.

sezanzeb commented 2 years ago

When I press AltGr + ShiftL + z, the ‘Key’ column says ISO Level3 Shift + Shift L + Cyrillic ya

I don't think this matters. Key-mapper tries to visualize your pressed input keys in a human readable format based on xmodmap, but it actually remembers the keycodes.

The problem is, if the en_US layout is selected, AltGr + ShiftL + z produces Y, and it ru_RU is seleted, it produced H

What?

When I try to change the mapping Cyrillic_en for ѣ, the status bar says that it is not recognised (see below)

expected, key-mapper only knows the fully written name for the symbol (like Cyrillic_en) and not the actual symbol

Fifis commented 2 years ago

Okay, I have tried adding the full written name for tilde (~), but it is not in the list... Here is a video showing that the name of the tilde symbol is not in the full list. Maybe I am stupid, but how can I bind the insertion of the simplest ASCII tilde to AltGr ~ (the latter key being named Cyrillic_io)?

output

sezanzeb commented 2 years ago

If tilde is not in your key-mapper-control --symbol-names output, please go over https://github.com/sezanzeb/key-mapper/issues/210#issuecomment-974907749 one more time

Fifis commented 2 years ago

xmodmap turned out to be a buggy mess because instead of the documented 6 levels, it had 7 or more, and the assignment would screw up the en_US layout. It also took a lot of time to reload all the mappings (40 seconds to restore the old mapping after some changes—it was much quicker to kill X and start from scratch).

I managed to solve this issue via xkbcomp. E.g. this is what I had had (two groups, ru_RU and en_US), after xkbcomp -xkb $DISPLAY:

xkb_symbols "pc+ru+us:2+inet(evdev)+group(alt_shift_toggle)+level3(ralt_switch)+compose(102)+nbsp(level3n)+termi" {

    name[group1]="Russian";
    name[group2]="English (US)";
<...>
key <AD06> {
        type= "FOUR_LEVEL_SEMIALPHABETIC",
        symbols[Group1]= [     Cyrillic_en,     Cyrillic_EN,             yen,        NoSymbol ],
        symbols[Group2]= [               y,               Y,             yen,        NoSymbol ]
    };
<...>
}

And this is what added the necessary keys to the map:

key <AD06> {
        type= "FOUR_LEVEL_SEMIALPHABETIC",
        symbols[Group1]= [     Cyrillic_en,     Cyrillic_EN,             U0463,        U0462 ],
        symbols[Group2]= [               y,               Y,             yen,        NoSymbol ]
    };

In cases where there was no third level defined, changing ALPHABETIC to FOUR_LEVEL_SEMIALPHABETIC would do the trick, i.e. changing

key <AD09> {
        type= "ALPHABETIC",
        symbols[Group1]= [  Cyrillic_shcha,  Cyrillic_SHCHA ],
        symbols[Group2]= [               o,               O ]
    };

to

key <AD09> {
        type= "FOUR_LEVEL_SEMIALPHABETIC",
        symbols[Group1]= [  Cyrillic_shcha,  Cyrillic_SHCHA, U0473, U0472 ],
        symbols[Group2]= [               o,               O, NoSymbol, NoSymbol ]
    };

would add ѳ to the third level of щ.

xinput list would reveal AT Translated Set 2 keyboard id=11 [slave keyboard (3)], so after making the changes, saving the modified file as great.xkb and doing xkbcomp -i 11 great.xkb $DISPLAY, I got the desired extra keys in the 3rd and 4th levels.

So, the full solution to the original question (adding four old Cyrillic letters in lower- and uppercase plus mapping the tilde) comes in the form of an XKB file that modifies the existing layout:

xkb_keymap {
    xkb_keycodes { include "evdev+aliases(qwerty)" }; 
    xkb_types { include "complete" };
    xkb_compatibility { include "complete" }; 
    xkb_symbols {
        include "pc+ru+us:2+inet(evdev)+group(alt_shift_toggle)+level3(ralt_switch)+compose(102)+nbsp(level3n)"
        include "terminate(ctrl_alt_bksp)+typo(base):1+typo(base):2"
        name[group1]="Russian";
        name[group2]="English (US)";

        key <AD06> {
            type= "FOUR_LEVEL_SEMIALPHABETIC",
            symbols[Group1]= [     Cyrillic_en,     Cyrillic_EN,             U0463,        U0462 ],
            symbols[Group2]= [               y,               Y,             yen,        NoSymbol ]
        };
        key <AD07> {
            type= "FOUR_LEVEL_SEMIALPHABETIC",
            symbols[Group1]= [    Cyrillic_ghe,    Cyrillic_GHE,           U0475,        U0474 ],
            symbols[Group2]= [               u,               U,           U20B4,        NoSymbol ]
        };
        key <AD08> {
            type= "FOUR_LEVEL_SEMIALPHABETIC",
            symbols[Group1]= [    Cyrillic_sha,    Cyrillic_SHA, U0456, U0406 ],
            symbols[Group2]= [               i,               I, NoSymbol, NoSymbol ]
        };
            key <AD09> {
            type= "FOUR_LEVEL_SEMIALPHABETIC",
            symbols[Group1]= [  Cyrillic_shcha,  Cyrillic_SHCHA, U0473, U0472 ],
            symbols[Group2]= [               o,               O, NoSymbol, NoSymbol ]
        };
        key <TLDE> {
            type[group1]= "FOUR_LEVEL_SEMIALPHABETIC",
            type[group2]= "FOUR_LEVEL",
            symbols[Group1]= [     Cyrillic_io,     Cyrillic_IO,        asciitilde,        approxeq ],
            symbols[Group2]= [           grave,      asciitilde,        NoSymbol,        approxeq ]
        };
    };
    xkb_geometry { include "pc(pc105)" };
};

The issue can be closed, and the solution I found, in fact, achieves the desired Cyrillic mapping without the use of key-mapper at all, purely with xkb, but maybe this solution will be insightful and give the contributors an idea about what could be done to circumvent this issue.

Again, thank you very much for your time and suggestions!

sezanzeb commented 2 years ago

but maybe this solution will be insightful and give the contributors an idea about what could be done to circumvent this issue.

Thanks, but key-mapper only uses xmodmap to gather information for human-readable convenience. It is designed to work with any environment that has, or doesn't has xmodmap available by acting like a keyboard that sends numeric scancodes to the environment.

Again, thank you very much for your time and suggestions!

You're welcome