Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am interested in hearing how people use this level of customisation in their workflow, whether it is through this particular tool or by configuring at the keyboard firmware level. This is a new paradigm for me.


I only buy keyboards that allow for remapping the keys at the firmware level. Either via custom firmware or configuration file. This means the mappings are inherently cross OS platform and just work. Example, ESC key replaces the Caps Lock since ESC is used more often and rarely is Caps Lock needed.

With multi-profile keyboard mapping, I even have a gaming profile so I don't have to remap keys in the game(s).

Do the same with mice. Cross OS, my mouse can lower, raise, and mute the volume. Great in games too with improving the would audio to either listen for those to sneak up on or quickly lowering the extreme loud noise.

Only grip is that laptop keyboards need to move to the same custom firmware / configuration mapping like external for better cross OS support / user experience.


The firmware level is unfortunately unaware of the app you're running, and also can't do scripts, which adds a serious limitation on the many cool features you could do with integrated keybinding tools. Then as you noted there is laptops...


I use a combination of keyboard firmware(on one machine) and a similar tool(xremap). Mostly for:

- turning my CapsLock into escape. As a vim user I use it all the time

- when CapsLock is held it turns into a hyper key. Hyper+e to switch to Emacs window, hyper+b to browser and so on

- creating application independent maps that work on Linux and MacOS: ctrl+w is always "kill last word", super+w to kill a tab or a window

- invoking hammerspoon commands on MacOS that tile windows, bring up window switcher, etc.


Would you mind Sharing your hammerspoon Config? Are you tiling your windows similar to i3 or sway?


Found a config that seems much cleaner than my lua mess and at a glance it has the key tiling functions[1]. Check set-window-fraction function and its callsites.

[1]: https://github.com/kbd/setup/blob/main/HOME/.hammerspoon/ini...


Thank You. Nice. Fennel lang


Sure. Should be able to extract the relevant bits tomorrow.

I tried some tiling WMs on MacOS(Amethyst?), but they never truly felt like tiling WMs on Linux. I could never reliably switch focus where I wanted it to go. This is not to disparage those projects; my config works well enough and I may not had given them a proper chance.

My tiling is manual and closer to Windows snap feature mixed with Power Toys zones.


Fwiw I'm somewhat happy combining AutoRaise for focus-follows-mouse and rectangle for tiling.

It's not as good as a dedicated tiling wm on Linux - but it's less terrible than MacOs' mouse/touchpad chauvinism.

https://github.com/sbmpost/AutoRaise

https://github.com/rxhanson/Rectangle


On Linux I often use mouse follows focus. I switch to a webbrowser and have a reasonable guess where the cursor is. IIRC that was a pain with Amethyst and my hammerspoon config. Have you set up something like this?


No, I've not found anything that gives workable mouse follow focus. But I've not looked very hard.


I am finally settled on aerospace.app which is close enough to i3 for me. Now hammerspoon for some Automation :)


People choosing a non local keyboard usually require this level of adjustments for daily use of their computer.

If you want to type french with a standard US keyboard for instance, it will require at least some small layering. Typing a CJK language will require some more tweaks, in particular the dual action on keys saves a lot. If you intend to type both accented and CJK with let's say the UK international layout, you'll need every help you can get.

When using vim more heavily, having an escape key remap as the control key's single action is also a huge QOL.

Once you're in it, it opens the door for a lot of small improvements.


I just use either emacs or neovim to edit the configuration. Kanata can run on top of your xkb layout. So I use that to select one of the 3 readily-available keyboard layouts. Kanata manages 2 layers on top of that. Both layers a very sparse and mostly just pass the keystrokes transparently to xkb. Layer 1 is almost entirely pass-through, except for one tap-dance key to switch layers. It behaves more or less like a native xkb keyboard. Layer 2 adds some useful features like home-row-mods.


I don't use this, but as an example:

I like to use a US Intl keyboard layout for programming but as I am German I need äöüß a lot - so I've used a custom keymap for caps-aous for years (and a couple other things). Yes, you can get most OSes to somehow do this, but just doing it at firmware level would fix SO MANY PROBLEMS.


the main draw for me was being able to use the spacebar as a modifier, and being able to press ikjl when the spacebar is held to send the arrow keys. the ctrl and shift keys still work while the spacebar is being held which makes it great for moving the caret around and editing text, like using ctrl + right then ctrl + shift + left to select a word, but without having to move away from the home row

i also have home, end, backspace, delete, pgup, pgdn, all close enough to the homerow on that layer as well so i dont have to reach out to the corners of the keyboard

then finally on the edsf keys i have it send whether the vscode shortcuts are to move the line up or down or indent/unindent.

most of the rest of the things i have remapped are just single key things that can be done in most other remappers, sending esc when the alt key is tapped, capslock to ctrl etc


What function and timings do you use to make the space bar a modifier, but still work normally when typing? I tried a few things but couldn't figure out what to use.


tap-hold-release 200 200 spc (layer-toggle spc_layer)


That's what I am doing right now. The issue seems to be when I am sloppy with the spacebar and some unknown input processing. When this is input:

  - keydown space
  - keydown a
  - keyup a
  - keyup space
I normally get the output <space><a>, interpreted in order of keydown, but kanata outputs in order of keyup, so I get <a><space>.


im using the "kanata_gui_cmd_allowed" version on windows, but maybe if youre on linux or mac maybe it might work differently im not sure

i dont know if this would make a difference but i have "process-unmapped-keys yes" in my defcfg section


This doesn't have to be a complex workflow.

My work laptop from Dell has an idiotic "copilot" key which sends something like ctrl+shift+f23 - three separate key presses on the scancode level.

I use dkey to map this otherwise useless crap chord to Ctrl.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: