News for hackers. Stuff that matters.
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).
Re:Mac Keyboard with Hidutil by bt1a on Thursday April 13, 2023 @10:52AM (#35556375)
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.

Re:Mac Keyboard with Hidutil by SSLy on Thursday April 13, 2023 @11:55AM (#35557398)
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.
Re:Mac Keyboard with Hidutil by csdvrx on Thursday April 13, 2023 @04:50PM (#35561879)
Do either handle the modifier bits when you remap? So that they are not set unless you want to?
Re:Mac Keyboard with Hidutil by psd1 on Thursday April 13, 2023 @03:14PM (#35560659)
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.
Re:Mac Keyboard with Hidutil by 1-more on Thursday April 13, 2023 @12:03PM (#35557556)
Hold-tap is phenomenal in QMK if you want it built in to a keyboard you're building too.

https://qmk.fm

Re:Mac Keyboard with Hidutil by xiande04 on Thursday April 13, 2023 @12:52PM (#35558382)
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.

Re:Mac Keyboard with Hidutil by 355E3B on Thursday April 13, 2023 @01:16PM (#35558798)
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)

Re:Mac Keyboard with Hidutil by seanw444 on Thursday April 13, 2023 @01:39PM (#35559166)
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)

Re:Mac Keyboard with Hidutil by xiande04 on Friday April 14, 2023 @12:08PM (#35571129)
Oh! Good to know! And your use-case is exactly what I'm using Karabiner for.
Re:Mac Keyboard with Hidutil by 1-more on Thursday April 13, 2023 @05:33PM (#35562377)
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)