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:

16 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.

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