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

How to use number keys in keymaps? #19

Open
dact221 opened this issue Dec 20, 2024 · 2 comments
Open

How to use number keys in keymaps? #19

dact221 opened this issue Dec 20, 2024 · 2 comments

Comments

@dact221
Copy link

dact221 commented Dec 20, 2024

Dear developer,

I am replicating xah-fly-keys emacs mode using ModalEditor. I was able to set most keybindings, but numbers do not work. I tried quoted and unquoted numbers, but they just do not work in normal mode. The commands I was using are valid since they work fine when assigning them to a letter. For example:

module.exports = {
    normal: {
        m: "command",
        6: "command",
        "6": "command"
    }
}

In the example, only m worked.

Does ModalEditor support numbers for keybindings?

Thank you for your great work on ModalEditor!

Diego

@DCsunset
Copy link
Owner

Hi,

Currently, numbers are not supported because they are processed as prefix number (like how it works in the original Emacs or Vim). However, I do agree that numbers should be customizable as well.

The solution I have in mind is to add an option to disable processing numbers as prefix. Will this change work for your case?

@dact221
Copy link
Author

dact221 commented Dec 31, 2024

Hi @DCsunset

An option to disable processing numbers as prefix would work for my case. I have not seen prefix numbers in Xah Fly Keys. Meanwhile, my workaround is defining number keybindings directly in VSCode with "when": "modalEditor.mode == 'normal'".

If you implement the option, I will be happy to test it. Thank you!

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

2 participants