Configurable keyboard shortcuts in the editor

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:

23

And instructions:

18 Likes

:open_mouth: No way…
Best Feature 2020.

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.

6 Likes

Tear of joy!

1 Like

Are those the command exposed to the shortcuts or there’s more?
Looking to bind build html5 :stuck_out_tongue:

1 Like

Yeah, now we need aaaaallll the other commands. “Add Component File” and “Add Game Object File” are biggies for me.

1 Like

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. :slight_smile:

5 Likes

Got it. Makes sense. Thanks for the explanation.

Well, being able to change them at all is a big step in the right direction anyway. Thanks for your efforts!

2 Likes

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?

Are you restarting the editor after changing? Does it work to change it at all? For instance try changing Ctrl-C to Ctrl-Q or something.

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.

1 Like

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)

I have the same problem as @morgerion. I would like to use Ctrl-Ins and Shift-Ins for copy and paste, but it doesn’t work. Ctrl-Y does, however, so it’s probably the ‘Ins’ key that isn’t intercepted. Should I open an issue on github?

btw: under Windows, Ctrl+Ins and Shift+Ins are standard alternatives to Ctrl+C and Ctrl-V. I think they should be in the default mapping under windows

Added an issue

1 Like