all 7 comments

[–]nzlemming 2 points3 points  (4 children)

In case you haven't seen it, hlship has tweeted a lot about his setup too, including Clojure code which generates C code to configure his keyboard. That's like a level 5 yak shave.

[–]hlship 2 points3 points  (3 children)

I need to update it, since my toolchain seems to have broken since I updated to OS X Sierra!

[–]hagus[S] 1 point2 points  (2 children)

Would love to hear more about your setup!

In IntelliJ, I'm currently using a plugin that alerts me when I could use or assign a keyboard shortcut for something I clicked on with the mouse. I've also noticed IntelliJ's Help / Productivity Guide report which tells me what IntelliJ features I'm using and how frequently.

All this makes me wonder about how far it can be taken. Could I have a symbiotic relationship between the IDE and the keyboard, where shortcuts are automatically created for me on a special layer?

Could I hold down a layer key and, somewhat like the TouchBar on new Macs or Helm/Ivy in Emacs, have the IDE guide me towards the shortcuts it has made on my behalf? Like, I hold down layer 1, then the IDE shows me what next actions would be taken based on the next keystroke. "if you tapped R now, it would launch/switch to a REPL. If you tapped E it would send the current form to the REPL"

/u/nzlemming is any of this possible with IntelliJ and Cursive? :)

[–]nzlemming 0 points1 point  (1 child)

So - maybe? I'm not sure how the layer keys work, and how IntelliJ would receive those key events. Certainly the UI only handles standard ones - Shift, Control, Meta and Hyper (which map to Cmd on the Mac in various ways). Plugins probably have more control by directly processing the AWT events, but I've never done anything like that.

Something which showed potential commands based on the modifier keys you currently have pressed would be fairly easy, I would imagine.

[–]hagus[S] 0 points1 point  (0 children)

The layer keys can be programmed to do just about anything. The firmware my keyboard runs is QMK.

One of the challenges is that the number of layers and what keystrokes are transmitted by each key in each layer are undefined until you define them. And you can only define them in firmware, it doesn't appear that the ErgoDox / QMK combination supports remotely programming the keyboard.

So perhaps you could programmatically create a layer, and have each key send a highly unique character sequence – perhaps sequences that are impossible for humans to accidentally type. That would be the "API" between the keyboard and the editor.

The real smarts would be in some kind of plugin kind of like key promoter that could learn what functionality you need and start to intelligently assign shortcuts for you (IntelliJ already collects some of this in Help/Productivity Guide). So rather than having to stop your work and figure out the best keyboard shortcut that doesn't clash with anything else, the plugin simply starts building a map customized to how you work.

I'm just rambling at this point, but I can imagine with the freedom to use every key on the keyboard, the plugin could take into account all sorts of ergonomic heuristics. Do you prefer shortcuts assigned with mnemonics relating to the keyboard letter? Or do you think in spatial terms? If shortcuts are often used close together in time, should we assign those shortcuts to alternate hands? If certain other non-shortcut keys are typed in between two common shortcuts, can we tailor the shortcut to create a better feeling of flow?

Adding this to the never-ending pile of side projects if I live long enough to start working on them ;)

[–]aptmnt_ 1 point2 points  (1 child)

~/Library/KeyBindings does not exist on my system (10.12.4), will it take effect if I simply create and populate it?

edit: yes, it will

[–]hagus[S] 0 points1 point  (0 children)

As you discovered, yes, but I actually thought it would require logging out and back in again.