Is there a way to override Visual Studio Keybindings in extension? #459
Unanswered
aglasencnik
asked this question in
Q&A
Replies: 3 comments 13 replies
-
I haven't found a way to change existing keybindings from an extension, unfortunately. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Ahh, yes you can intercept either an existing command and take it over, or you can listen to a keypress |
Beta Was this translation helpful? Give feedback.
3 replies
-
For the keystrokes, you check it like this: https://github.com/madskristensen/Surrounder/blob/e2aefe27cf806f7a3a37568b57a475579768094b/src/InsertTextCommand.cs#L37 No, you don't need .vsct to intercept a command |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am wondering if there is a way of overriding default Visual Studio Keybinding behaviours in my extension?
Basically I am developing an extension and I have quite a lot of keybindings set. But because of safety all of them have a "prefix" keys which come before the actual keys eg. Ctrl + Shift + Alt + E (prefix) then Ctrl + D.
I would want to remove those "prefix" keys, so I would just have the actual keys like Ctrl + D, I thought if I could check if those were pressed or something and if my action/command did some stuff then the default behaviour wouldn't go through, and if my extensions action doesn't go through it must do the default behaviour.
Is there any way to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions