Thanks to a community contribution from Slack user Saikyun we now have a first version of configurable keyboard shortcuts in the editor. With the latest editor update you’ll find a “Path to custom keymap” option in the Preferences window:
But…I’m having some issues with it. It seems like there’s a problem with mapping single keys. I tried to remap the keys used to switch transform tools (move-tool, scale-tool, rotate-tool). Using W or E or A always seems to work, no matter which tool they’re used for, but other letters like U, L, M, or Q don’t work. Though they work fine if I put add Alt to them. I’m on Windows.
In the source code for keymaps, there’s this piece of code:
;; These are only (?) used in contexts where there is no text field
;; interested in the actual typable input.
(def ^:private default-allowed-typable-shortcuts
#{"A" ; :add
"E" ; :rotate-tool
"F" ; :frame-selection
"R" ; :scale-tool
"W" ; :move-tool
"Shift+A" ; :add-secondary
"Shift+E"}) ; :erase-tool
To my understanding, the reason for this seem to be that the keymap I opened up to customization seem to work globally, even when in a text field. While commands that can be interpreted as text (e.g. “A”) can’t be global hotkeys, since then you wouldn’t be able to type those characters.
I tried replacing Ctrl-C and Ctrl-V with Ctrl-Insert and Shift-Insert (like in some old IDEs).
These combinations didn’t work.
Is there any solution for this?
Yes, of course, I restarted the editor (many times).
Yes, I have checked other keyboard shortcuts (e.g. Ctrl-Q or Ctrl-M) - they all work.
Presumably Insert is not catching.
Just a note that’s maybe not that clear, the path will be saved in the users registry, so you can have different keybindings on different computers/developers. In Windows you can find it in the Window Registry Editor (search for custom-keymap-path).
(Found out when I had an editor crash due to I was adding an invalid path: .\keymap_win.edn)