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

Feature Requests: support sequence of keys for keybinding and modes in keynavrc #53

Open
GeekyPeas opened this issue Aug 8, 2020 · 0 comments

Comments

@GeekyPeas
Copy link

GeekyPeas commented Aug 8, 2020

Feature-1: Sequence of Keys for keybinding

What?:

The current supported format in keynavrc is:

keybinding cmd1,cmd2,cmd3...

However I want to do this:

{key1, key2, key3...}  {cmd1, cmd2, cmd3...}

When I say {key1, key2, key3...} I do not mean for them to be pressed simultaneously but instead to be able to press them one-after-another. That is, I want keynav to keep listening for key presses till it finds a matching key-sequence to which a command-sequence has been assigned.

(Remark: Of course the user has to take care to keep all key-sequences prefix-free. But this is similar to expecting the user to not use the same keybinding multiple times in their config file.)

keynav already implements this in a limited manner with grid-nav. When grid-nav is on, keynav waits for two key-presses before executing the corresponding cell-select command.

Why?:

Say, I would like to work on a 20x20 grid and want to assign custom key-bindings for cell-select-ing each of the 400 cells then, there are not enough keybindings for all the cells!

Feature-2: Modes

I also want to do something like this:

keybinding enter-mode <mode-name>
def mode <mode-name>
{
    ....
    keybinding cmd1,cmd2,cmd3...
    ....
    Escape exit-mode <mode-name>
}

And the desired behavior is: When you enter a mode, the keybindings defined for that mode overrides the global keybindings.

Once again keynav already implements this in a limited manner with grid-nav. Well, grid-nav is like a mode. When grid_nav is on keynav ignores the keybindings in the keynavrc until one Escapes out of grid-nav mode.

Why?:

I would like to reuse same keybindings to do different things (like in vim) by some prefacing them with some mode or context. For example I would like my h,j,k,l to do different things depending on whether I am on grid size 3x3 versus on grid size 2x2.

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

1 participant