[EDITOR] Hotkey Configuration

Started by WillLem, December 10, 2024, 12:09:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WillLem

I'm pleased to report that the next version of the Editor (2.7.3) will include full Hotkey configuration! :lemcat:

It's work in progress at the moment, but very promising so far. The idea is that the green text will show in red if the chosen hotkey is a duplicate (a text label will also advise of this, and the Assign New Key button will be unavailable). I've also yet to map the hotkeys themselves to Editor actions, but everything is in place ready for this to happen (it's tested working with one action so far):


WillLem

Well, the form is all working nicely and can save/load to/from .ini:





The only thing left to do is match the hotkeys to the various actions throughout the codebase (they're currently still set directly to key/mouse actions). That will most likely turn up a few challenges, particularly with mouse actions and anything that won't take a regular key as a modifier - we'll see!

WillLem

#2
As predicted, there are quite a few challenges when it comes to matching hotkeys to actions. Some are gimmes and the codebase already supports the key being pretty much anything. Others present significant challenges:

:tal-gold: Hotkeys which require mouse input (i.e. select/drag actions) present a unique problem: we more or less need to insist that a mouse click is involved, whatever the keypress might be. We can give the user the choice of which mouse button to use, though. - sorted this one out; some actions are mouse-mandatory and require having a mouse button as a hotkey (modifier optional)

:tal-gold: Direction arrows are similarly special; these perform a number of actions depending on modifier. Maybe we need to insist on these being non-assignable in general, and instead assign only modifier keys to the existing directions (Up, Down, Left, Right) which we assume to be pre-assigned to the arrow keys. - sorted this one out; direction keys can be anything, but modifiers must be applied to each individual key. It's only an extra 6 hotkeys, more on this later

:tal-gold: It's necessary to disallow certain hotkey actions if a text input field is active (such as "Title", "Author", or a numeric such as "Save Requirement", "Time Limit"). - sorted this one out; hotkey actions are only listened for when text inputs are not focused

This will have to be done just right!