kalamine
kalamine copied to clipboard
Add support for arrow keys in TOML layout descriptors
Hello,
I would like to define directional arrow keys in my keymap on the altgr layer.
See the example:
altgr: |
╭╌╌╌╌╌┰─────┬─────┬─────┬─────┬─────┰─────┬─────┬─────┬─────┬─────┰╌╌╌╌╌┬╌╌╌╌╌╮
┆ ┃ │ │ │ │ ┃ │ │ │ │ ┃ ┆ ┆
┆ ┃ │ │ │ │ ┃ │ │ │ │ ┃ ┆ ┆
╰╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
· ┃ │ │ │ │ ┃ │ │ │ │ ┃ ┆ ┆
· ┃ │ │ ↑ │ │ ┃ │ │ │ │ ┃ ┆ ┆
· ┠─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
· ┃ ⁽ │ │ │ │ ⁾ ┃ │ │ │ │ ± ┃ ┆ ┆
· ┃ ( │ ← │ ↓ │ → │ ) ┃ │ │ │ │ + ┃ ┆ ┆
╭╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┴╌╌╌╌╌╯
┆ ┃ │ │ ¦ │ │ ┃ │ │ │ │ ≠ ┃ ·
┆ ┃ [ │ ] │ | │ { │ } ┃ \ │ │ │ │ = ┃ ·
╰╌╌╌╌╌┸─────┴─────┴─────┴─────┴─────┸─────┴─────┴─────┴─────┴─────┚ · · · · · ·
I tried using the Unicode arrow keys, but they are not transformed by kalamine, so when pressing the key, those characters are literally printed.
However, if I modify the .xkb
manually and transform uparrow
into Up
, it does the trick and it correctly references the arrow key.
Is it a feature that is missing in kalamine? Is there a way to tell that I want the actual directional arrow key from within my yaml
file?
Thanks
Hello,
it would be nice to have also the top, bottom, page up and down keys.
Honestly, that really sounds like a job for kanata to me. But having some kind of support for Neo-like layouts would be neat, indeed.
I’m reconsidering this. Kalamine should allow to do whatever is possible on the all three target platforms (windows, macOS, linux), and this is certainly doable.
Maybe we could use \
escape codes for that:
-
\h
\j
\k
\l
or\←
\↓
\↑
\→
for the arrow keys -
\H
\J
\K
\L
or\⇱
\⇟
\⇞
\⇲
for the home/end and page up/down keys -
\t
for Tab,\n
for Enter,\s
for Space - additional codes for Backspace, Delete, Escape, no-break spaces?
On Windows, if I am not mistaken, the feature works by using the proper VK. It should be ok to remap a key, but if you want it on a layer, I do not think you can use such special VK for both text & arrow.
Summing up what @wismill has just explained on a Discord conversation, supporting arrow keys in an AltGr layer might be feasible if the driver changes the VK when a modifier is pressed (and that’s what this Japanese keyboard layout does, apparently).
So a reasonable first step would be to first support special key assignments from the command-line, e.g. to assign Backspace to the [B] key when applying an angle-mod.