Hacking Your Keyboard with Karabiner
kau.sh
kau.sh
For a simple keyboard remapping I use built-in 'hidutil' command. https://developer.apple.com/library/archive/technotes/tn2450...
There is also https://hidutil-generator.netlify.app/
https://github.com/FSecureLABS/OSXFuzz/blob/600f28c1c4a1211c....
"HIDKind",
"HIDInterfaceID",
"HIDSubinterfaceID",
"HIDOriginalSubinterfaceID",
"HIDParameters",
"HIDVirtualDevice",
"HIDKeyRepeat",
"HIDInitialKeyMapping",
"HIDKeyMapping",
"HIDResetKeyboard",
"HIDKeyboardModifierMappingPairs",
"HIDKeyboardModifierMappingSrc",
"HIDKeyboardModifierMappingDst",
"HIDKeyboardCapsLockDoesLock",
"HIDKeyboardSupportsF12Eject",
"HIDKeyboardSupportedModifers",
"HIDPointerResolution",
"HIDPointerResetPointer",
"HIDPointerConvertAbsolute",
"HIDPointerContactToMove",
"HIDPointerPressureToClick",
"HIDPointerButtonMode",
"HIDPointerButtonCount",
"HIDPointerAcceleration",
"HIDPointerAccelerationSettings",
"HIDPointerAccelerationTable",
"HIDScrollReset",
"HIDScrollResolution",
"HIDScrollReportRate",
"HIDScrollAcceleration",
"HIDScrollAccelerationType",
"HIDScrollAccelerationTable",
"HIDScrollResolutionX",
"HIDScrollResolutionY",
"HIDScrollResolutionZ",
"HIDScrollAccelerationTableX",
"HIDScrollAccelerationTableY",
"HIDScrollAccelerationTableZ",
"HIDScrollMouseButton",
"HIDScrollZoomModiferMask",
"HIDTrackpadAcceleration",
"HIDMouseAcceleration",
"HIDClickTime",
"HIDClickSpace",
"HIDWaitCursorFrameInterval",
"HIDAutoDimThreshold",
"HIDAutoDimState",
"HIDAutoDimTime",
"HIDIdleTime",
"HIDBrightness",
"HIDAutoDimBrightness",
"HIDFkeyMode",
"HIDStickyKeysDisabled",
"HIDStickyKeysOn",
"HIDStickyKeysShiftToggles",
"HIDMouseKeysOptionToggles",
"HIDSlowKeysDelay",
"HIDF12EjectDelay",
"HIDMouseKeysOn",
"HIDUseKeyswitch",
"HIDDisallowRemappingOfPrimaryClick",
"HIDMouseKeysEnablesVirtualNumPad",
"HIDResetLEDs",
"HIDAccelCurves",
"HIDTrackingAccelCurves",
"HIDScrollAccelCurves",
"HIDAccellCurvesDebug",
"HIDScrollAccelCurvesDebug",
"HIDAccelGainLinear",
"HIDAccelGainParabolic",
"HIDAccelGainCubic",
"HIDAccelGainQuartic",
"HIDAccelTangentSpeedLinear",
"HIDAccelTangentSpeedParabolicRoot",
"HIDAccelTangestSpeedCubicRoot",
"HIDAccelTangentSpeedQuarticRoot",
"HIDAccelIndex",
"HIDScrollCountMaxTimeDeltaBetween",
"HIDScrollCountMaxTimeDeltaToSustain",
"HIDScrollCountMinDeltaToSustain",
"HIDScrollCountIgnoreMomentumScrolls",
"HIDScrollCountMouseCanReset",
"HIDScrollCountMax",
"HIDScrollCountAccelerationFactor",
"HIDScrollCountZero",
"HIDScrollCountBootDefault",
"HIDScrollCountReset",Edit: can perhaps use https://github.com/gkpln3/CapsLockNoDelay
To your knowledge, is there any cli way to assign key combinations to menu items as seen in system preferences -> keyboard shortcuts?
$ defaults read org.mozilla.firefox NSUserKeyEquivalents
The encoding for the modifier keys is given here: https://developer.apple.com/library/archive/documentation/Co...Karabiner can do more than simple 1:1 key remapping. For example, my capslock key is now a hyperkey when pressed and ⌘T when tapped. If that is possible w/ hidutil, please let me know and I stand corrected.
Let's get off the "I don't have a use for it, so it's useless/bad" train, please.
Eventually I wrote rcmd (https://lowtechguys.com/rcmd) to streamline this workflow of switching/launching an app by the first letter of its name.
It will dynamically map Right Command + first letter of app name to already running apps, and you can map your own letters by just pressing Right Command + Right Option + letter to assign.
I eventually replaced everything I was using Karabiner for with specialized apps like rcmd, HyperKey (https://hyperkey.app/) and skhd (https://github.com/koekeishiya/skhd).
I'm still missing the left/right Shift press once for parentheses, but I can live without it.
Of course you can do this with stock macOS too.
System Prefs > Keyboard > Keyboard > Modifier Keys... > Apple Internal Keyboard + Caps Lock Key
You need a tool like this https://github.com/gkpln3/CapsLockNoDelay
Once it’s one to many it’s a nightmare. You have to write scripts in a complicated format (full time professional programmer here) and they don’t even give you the facility to edit these scripts from within the app.
https://karabiner-elements.pqrs.org/docs/json/external-json-...
Why is it more complex to configure than an IDE? I don’t get it.
[1]: https://qmk.fm/
I really should explore its other uses.
(I'm not actually against the Touch Bar. I find it useful for a few things such a screen shots. But escape should never have been on it)
Update: for simple keyboard remapping there is built-in `hidutil` command
https://developer.apple.com/library/archive/technotes/tn2450...
The generator doesn't make it clear which key is "§" on a uk keyboard. From a quick Google it's listed as "none_us_backslash".
I use it for example to remap CAPS -> CTRL and CAPS + ' = `. Sometimes it just enables caps lock instead.
Also, after few hours of use laptop starts to feel as if it's lagging. 1 key press will output multiple letters. The only solution is to restart karabiner every few hours.
Anybody has any simple alternatives? Even if it costs a bit of money.
1. Map my Caps Lock key to be an Escape key when I tap it and a Control key when I hold it down.
2. Map my Shift keys to be left and right parenthesis when I tap them and Shift keys when I hold them down.
3. Map the Tab Key to be a Tab key when I tap it and an ALT key when I hold it down.
I also set my keyboard to Dvorak.
These modifications make it much nicer to work with Emacs and VS Code with Emacs bindings.
https://github.com/qmk/qmk_firmware/blob/master/docs/mod_tap...
I use an 80% because I don't actually need the numpad (I can type at full speed using the number row instead of reaching over for the numpad).
Using the arrow key without looking is simple because it's the only thing on the corner and I can return to the homerow easily without looking as well. It's faster for me to reach to it than to remap it to a Capslock (remapped to some other key) plus hjkl.
Instead I'm a gamer, so I set Capslock to activate an extra layer and use WASD for the arrow set so I have a set of arrow keys for either hand.
I like my Fn keys in groups of 4 across the top so I can easily reach for the correct one without looking.
[1] https://medium.com/@nikitavoloboev/karabiner-god-mode-7407a5...