Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keybindings redesign #1351

Open
ThePhilgrim opened this issue Jul 7, 2023 · 5 comments
Open

Keybindings redesign #1351

ThePhilgrim opened this issue Jul 7, 2023 · 5 comments

Comments

@ThePhilgrim
Copy link
Contributor

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
Copy link
Collaborator

rdbende commented Jul 7, 2023

New plugin? :D

@Akuli
Copy link
Owner

Akuli commented Jul 7, 2023

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
Copy link
Contributor

benjamin-kirkbride commented Jul 7, 2023

Very related to #1346

IMO this should be the requirements for keybindings:

  • default keybindings should be able to be set against actions, programmatically
    • multiple presets of "default" keybindings should be possible. Example: querty, vim, dvorak, azerty, etc
    • where possible, we should copy default keybindings from VSCode because it is the most popular editor and what most people are familiar with. Especially for features that it has popularized, like the command palette.
  • all keybindings should be able to be overridden with a config file
    • it should be possible to edit keybindings in a GUI, with those changes then being reflected into the config file
  • it should be possible to query what keybindings are currently set along with their associated actions, both in the way conceived in this issue (a big ol' list), as well as where the actions appear:
    • the command palette (see bottom for how this could look)
    • menubar
    • hover tips/descriptions
    • etc

This is obviously a lot, and is drastically different from how things work today, but I think that implementing #1342 will make much of this way, way more feasible to implement.


image

@Akuli
Copy link
Owner

Akuli commented Jul 7, 2023

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 Akuli changed the title See/set keybindings from menu Keybindings redesign Jul 7, 2023
@Akuli Akuli removed the plugin idea label Jul 7, 2023
@Akuli
Copy link
Owner

Akuli commented Jul 12, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants