39aldo39/klfc

How to use xkb keycode for position for hiragana-katakana key?

noctuid opened this issue · 2 comments

I want to remap my hiragana-katakana key. According to the documentation, I should be able to use the xkb keycode w/o the brackets. If I understand correctly, I can get this from the evdev file:

» grep 101 /usr/share/X11/xkb/keycodes/evdev
        <HKTG> = 101;   // Hiragana/Katakana toggle

But If I have [ "HKTG", "PrintScreen" ] as a permutation, I get the error Error in $.mods[1].permutation[0]: ‘HKTG’ is not a valid position

What is the correct way to do this?

I looked at the Japanese keys before once, but I am not certain what all the different keys do. In the xkb keycodes file there are all these keys:

// Keys that are generated on Japanese keyboards

//<HZTG> =  93; // Hankaku/Zenkakau toggle - not actually used
alias <HZTG> = <TLDE>;
<HKTG> = 101;   // Hiragana/Katakana toggle
<AB11> = 97;    // backslash/underscore
<HENK> = 100;   // Henkan
<MUHE> = 102;   // Muhenkan
<AE13> = 132;   // Yen
<KATA> =  98;   // Katakana
<HIRA> =  99;   // Hiragana
<JPCM> = 103;   // KPJPComma

But I am not sure what they all mean and I thought I also looked at a different source which had conflicting keycodes for them (don't know where). Do you an overview of the keys? Or should I just copy the xkb names and keycodes?

That looks the same as for me. Allowing HKTG and also "KatakanaHiragana" and "HiraganaKatakana" as names would be nice.

I'm unsure about other keyboards or if this information is helpful, but my thinkpad keyboard has the bottom row as fn, control, win, alt, muhenkan (keycode 102), space, henkan (keycode 100), katakana/hiragana (HKTG keycode 101), alt, printscreen, control. AE13/Yen is also keycode 132 for me (left of backspace), and AB11/Ro/backslash (left of right shift) is also keycode 97. Mapping Muhenkan, Henkan, Yen, and Ro already works as expected for me. The only thing missing is the Hiragana/Katakan toggle key.

The Japanese keyboards I've seen normally just have a hiragana/katakana/romaji toggle key rather than dedicated hiragana and katakana keys. I don't have KATA, HIRA, and JPCM keys, but those keycodes do match the ones listed in my evdev file.