dfhack icon indicating copy to clipboard operation
dfhack copied to clipboard

Alt-Number keybindings are not displayed in "Key Binding" list of hotkeys plugin

Open arzyu opened this issue 4 years ago • 2 comments

keybinding add Alt-W@dwarfmode/Default twaterlvl
keybinding add Alt-7@dwarfmode/Default twaterlvl

Both of these keybindings work, but Alt-7 keybinding isn't displayed in the "Key Binding" list.

version: dfhack 0.47.05-r2, macOS

arzyu avatar Aug 29 '21 03:08 arzyu

I haven't looked into this at all, but this sounds familiar. I fixed a similar problem in quickfort where I found that number keys could get encoded in either of two ways. More info here: https://github.com/DFHack/scripts/commit/d5156b25ac6b7401e04184d94abe0ad744c1828b

myk002 avatar Aug 29 '21 03:08 myk002

This is probably different - hotkeys displays bindings registered by the keybinding command, which are independent of DF's key event handling (and don't have two ways to handle printable keys, like DF's KEY and SYM tokens).

It looks like support for number keys was added to keybinding more recently than others (9eac4585b1), so maybe support for those was never added to hotkeys. I would be curious if F10 through F12 bindings show up there as well.

Edit: I think this is probably what would need to change: https://github.com/DFHack/dfhack/blob/e5ca5e48e90e205082d01d5cd15bbea062cb1e59/plugins/hotkeys.cpp#L47-L55

(not immediately seeing a great way to keep Core in sync with this plugin, although I believe this is the only other place that needs to be in sync currently.)

lethosor avatar Aug 29 '21 04:08 lethosor

Fixed in https://github.com/DFHack/dfhack/commit/4e7b4dc55488a5a3cc227c8bd3b8d75ac14ea92d

myk002 avatar Nov 28 '22 23:11 myk002