I’m new to Reform and wondering if it’s possible to type certain keys on the keyboard, namely: HOME, END, INSERT, DELETE, and PrintScreen/SysRq (including the Alt+SysRq commands for Linux kernel)? Or how do I create new key combinations to emulate those keys? Thanks!
For 2, there is no code yet to allow for different layers yet, i.e. it’s not possible to send a different scancode when a modifier is pressed. So 1 is the cleaner method. I wish there was a good config tool for xkb, that would make it much easier.
It will work with the keyboard, but it looks like it’s not possible to add new key combinations to enter missing keys using this method, or am I missing something?
Well, you have plenty of keys defined in /usr/include/linux/input-event-codes.h, any of those could be mapped. So yes, you cannot do combination, but you can generate any suitable keycode and handle it then by sway, mapping to a script (a hotkey effectively). Hotkeys won’t help when sway is not available of course (eg hangs or died).
So, after following the XKB configuration rabbit hole for a while, I’ve ended up with the following settings:
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types {
include "complete"
virtual_modifiers Hyper;
type "HYPER" {
modifiers = Hyper;
map[Hyper] = Level2;
level_name[Level1] = "Base";
level_name[Level2] = "Hyper";
};
};
xkb_compat { include "complete" };
xkb_symbols {
include "pc+us+inet(evdev)"
include "compose(menu)"
key <RWIN> { [ Hyper_L ] };
modifier_map Mod5 { <HYPR> };
key <LEFT> {
type = "HYPER",
symbols[Group1] = [ Left, Home ]
};
key <RGHT> {
type = "HYPER",
symbols[Group1] = [ Right, End ]
};
key <RTRN> {
type = "HYPER",
symbols[Group1] = [ Return, Insert ]
};
};
// xkb_geometry { include "pc(pc105)" };
};
This maps Hyper+Left/Right to HOME and END and unmaps Hyper from existing Super keybindings by remapping it to Mod5. Additionally, compose key on the «…» key next to Ctrl is enabled.
Unfortunately, I could only bind Hyper combinations with an extra virtual modifier defined in xkb_types section above - this either requires an additional types file along with the symbols file or saving XKB settings in a single xkbcomp-like keymap source file as above.
This file can also be loaded in sway using xkb_file input command as follows:
Thank you for your research. Could you please help me? Is there any way to modify this .xkb file to add multiple languages layouts and toggle combination?
For example, if I change include "pc+us+inet(evdev)"
to include "pc+us+ru:2+inet(evdev)"
Where can I add a layout toggle combination (like in "setxkbmap -optioon “grp:alt_shift_toggle”)?