Akuli / porcupine

A decent editor written in tkinter
MIT License
156 stars 46 forks source link

Keybindings redesign #1351

Open ThePhilgrim opened 1 year ago

ThePhilgrim commented 1 year ago

Currently, we can see the default keybindings in porcupine/default_keybindings.tcl and custom keybindings in keybindings.tcl in the config directory.

I would also appreciate a way to see all keybindings in a dialog window that could be opened from the menu, as well as configure specific keybindings there.

rdbende commented 1 year ago

New plugin? :D

Akuli commented 1 year ago

This is very different from how keybindings.tcl/default_keybindings.tcl work, but we could change that. I'm curious to know what @benjamin-kirkbride thinks about this, as he isn't a big fan of keybindings.tcl/default_keybindings.tcl.

benjamin-kirkbride commented 1 year ago

Very related to https://github.com/Akuli/porcupine/issues/1346

IMO this should be the requirements for keybindings:

This is obviously a lot, and is drastically different from how things work today, but I think that implementing https://github.com/Akuli/porcupine/issues/1342 will make much of this way, way more feasible to implement.


image

Akuli commented 1 year ago

I like the plan :)

Querying is already possible, and works through virtual events. This is in Porcupine debug prompt:

>>> utils.get_binding('<<Menubar:Edit/Find and Replace>>')
'Ctrl+F'
Akuli commented 1 year ago

Another disadvantage with keybindings.tcl / default_keybindings.tcl is that the edits won't do anything until you restart Porcupine. There's no good way to fix this, because it is by design just a file that runs and adds the key bindings (and also does other things), without any support for later undoing what it does.