Re:Mac Keyboard with Hidutil
by ink_13 on Thursday April 13, 2023 @10:42AM
(#35556225)
Interesting, but if I'm understanding this correctly, this can only do straight remaps. I'll stick with Karabiner Elements for its ability to make a key do one thing when tapped (e.g., send a keystroke like ESC) and a different thing when held (e.g., act as a modifier like CTRL).
[ Parent
| on HN ]
Yeah, Karabiner seems to be unmatched in terms of customization for power users. The main problem with straight key remapping is that you have to deal with the application layer having different keybindings for the same actions, even when you have the appropriate keys swapped. Same for navigating the OS if you're interested in duplicating Windows navigation functions in Mac ( Command+E to open Finder, Command+S for Spotlight Search, Ctrl+Shft+Esc to open Activity Monitor )
I spent a long time creating a giant karabiner config file for myself, but recently an MDM update at my work broke the virtual keyboard driver that Karabiner requires. I haven't figured out a way to install it. I may have to go begging to IT.
Do you think I can get something like this for windows or libinput/wayland?
Re:Mac Keyboard with Hidutil
by goosedragons on Thursday April 13, 2023 @12:09PM
(#35557658)
Kmonad or keyd. Keyd is Linux only but Kmonad is cross platform but harder to configure IMO. Both work everywhere in Linux including TTYs.
Do either handle the modifier bits when you remap? So that they are not set unless you want to?
PowerToys for Windows has a keyboard remapper. It has nowhere near the power of karabiner, but otoh you don't have to wade through karabiner's config file.
Hold-tap is phenomenal in QMK if you want it built in to a keyboard you're building too.
Karabiner has this. I never could use this. I've tried mapping A to control when held down, but there's always false negatives because I hit control too fast. I've also tried many other keys and different timings, but nothing works for me.
Instead, I map a key to one thing when pressed alone and another when pressed with other keys. Works so much better. I can't live without this now. I really wish QMK had this functionality, but I think it's only available in Karabiner.
QMK does have this, unless I’ve misunderstood your use case. My QMK keyboard has CAPS mapped to ESC when tapped, CTRL when pressed with other keys. In my keymap.c file, I’ve put my caps key as just:
MT(MOD_LCTL, KC_ESC)
I ended up putting arrow keys in my 60%, which shifted the layout (PCB limitations) to where I ended up having to sacrifice my / and ? for a shift key (to fit the empty space). So I ended up having to do something similar. Holding it down and pressing other keys makes it function as a shift. Clicking it by itself yields a period, and clicking it by itself with the other shift does a question mark. QMK is freaking awesome.
RSFT_T(KC_SLSH)
Oh! Good to know! And your use-case is exactly what I'm using Karabiner for.
Oh yeah I couldn't make it work with letters. Rather I added tap behavior to modifiers. In QMK my command keys are Esc and Enter when tapped, shifts are parentheses (like the space cadet keyboard), controls (outside of A and ;) are single and double quote, Options are braces, and hypers are angle brackets (which I should probably change to brackets since I don't really write JSX/TSX/HTML much any more)