rvaiya / keyd

A key remapping daemon for linux.
MIT License
2.52k stars 154 forks source link

zenkakuhankaku not working #686

Closed bobbens closed 3 months ago

bobbens commented 3 months ago

I'm using a very simple setting as below:

[ids]
*

[main]
` = zenkakuhankaku
ro = grave
yen = katakanahiragana

The ro and yen keybinding work fine, however, the zenkakuhankaku does not work. Pressing ` gives (keysym 0x0, NoSymbol). However,keyd monitor now reports it as zenkakuhankaku. Furthermore, trying to do the same with another key such as leftmeta = zenkakuhankaku also gives (keysym 0x0, NoSymbol). The correct keysym should be (keysym 0xff2a, Zenkaku_Hankaku). No errors are reported.

Also somewhat unrelated, but I don't find an equivalent for Eisu_toggle which I use with xmodmap. Does it not exist?

bobbens commented 3 months ago

Seems to be related to https://github.com/k0kubun/xremap/issues/230 . I've done the same thing there to "temporarily" fix it by using the hiragana key to switch IME, but it would be great to figure out what the issue actually is.

rvaiya commented 3 months ago

Is there a physical key on your keyboard which actually produces this keysym in the X jp keyboard layout? If so, can you post the xev output while pressing it?

bobbens commented 3 months ago

Is there a physical key on your keyboard which actually produces this keysym in the X jp keyboard layout? If so, can you post the xev output while pressing it?

There is a key (Japanese layout). Pressing it gives the following xev output.

KeyRelease event, serial 40, synthetic NO, window 0x1c00001,
    root 0x4a3, subw 0x0, time 38821206, (208,-49), root:(1199,537),
    state 0x0, keycode 49 (keysym 0xff2a, Zenkaku_Hankaku), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
rvaiya commented 3 months ago

It looks like the key you want to remap is grave. You can confirm/discover this by running keyd monitor and pressing the key of interest. Remember, keyd operates at the level of evdev keycodes, it has no knowledge of higher level concepts like keysyms. The existence of the zenkakuhankaku keycode would imply the existence of a dedicated scancode at some point, but I'm unsure of its provenance.

bobbens commented 3 months ago

It looks like the key you want to remap is grave. You can confirm/discover this by running keyd monitor and pressing the key of interest. Remember, keyd operates at the level of evdev keycodes, it has no knowledge of higher level concepts like keysyms. The existence of the zenkakuhankaku keycode would imply the existence of a dedicated scancode at some point, but I'm unsure of its provenance.

I do believe it's ` not grave because the following config is working:

` = hiragana

I would have preferred using the zenkakuhankaku instead of hiragana because it has the default behaviour of switching IME, but I was able to configure my IME to use the hiragana key instead (which I don't use normally). I haven't been able to debug it too much, but it seems to be a bug that is deeper than keyd. LIkely some difference between how evdev and keyboard input devices belong or something. I'll try to see if I can debug sometime and file a bug report at the correct source. Thanks!