Comments (6)
Thank you! I missed that section in the docs. I agree adding it by default might not be ideal - maybe some configuration flag or snippet in the docs would be the best solution.
Thank you for the great plugin! Maybe I will make some doom-flavoured config in the future 👀.
from vscode-which-key.
It is possible. See use-non-character-keys. As an example, for SPC w <right>
:
- Add the follow bindings to your user's user
keybindings.json
so we can intercept the<right>
key and send it as→
to which key.
{
"key": "right",
"command": "whichkey.triggerKey",
"args": "→",
"when": "whichkeyVisible"
}
- Add the following overrides to your user's
settings.json
so we have a entry that maps toSPC w →
"vspacecode.bindingOverrides": [
{
"keys": "w.→",
"name": "Focus window right",
"type": "command",
"command": "workbench.action.focusNextGroup"
}
]
But I would be a little bit hesitant to add that as the default, because up and down key can select different menu items in the QuickPick menu.
from vscode-which-key.
I'm having trouble binding the up/down keys.
Simply adding
{
"key": "up",
"command": "whichkey.triggerKey",
"args": "→",
"when": "whichkeyVisible"
},
along with the settings entry you mentioned above does not seem to do anything. I'm aware that I kept the right arrow, but I think that it should just call the "focus window right" binding we defined earlier for the right arrow (which works).
My theory is that vscode does not allow you to bind up/down in the quick pick menu. Maybe microsoft/vscode#98479 is related?
I'm wondering if you have any other workarounds, if I should comment on the linked issue, or if I should make a new issue.
Thanks!
from vscode-which-key.
Sorry. I didn't test all the arrow keys. Seems like it is evident by the issue you linked that up/down arrow are special case'd in the QuickInput. See https://github.com/microsoft/vscode/blob/main/src/vs/base/parts/quickinput/browser/quickInput.ts#L724-L741.
I don't see any workaround available unless vscode team changed how they handle those keys. Maybe try commenting on the linked issue to start?
from vscode-which-key.
Just a quick note before I comment on the issue (in a few days), I found that commenting out the dom.EventHelper.stop(event, true);
in the code you linked and building from source allowed the extension to override the shortcut while still allowing the key to work to navigate in other contexts.
from vscode-which-key.
That's interesting. I guess that's what stopping the dom event which bubbling up to shortcut handling? Anyway that's a very detailed comment on vscode 👍
from vscode-which-key.
Related Issues (20)
- New commands do not show in default menu HOT 1
- Unable to create when condition for pin/unpin editor HOT 4
- Option to selectively hide items from menu? HOT 3
- Support for VSCode Web HOT 3
- Navigate up / back in the menu structure HOT 2
- Show key bindings in menus HOT 3
- Support partial override HOT 1
- triggerKey Not Firing from edamagit HOT 7
- Weird behaviour with Github Pull Request extension HOT 1
- `whichkey.delay` causes a delay in `SPC SPC` shortcut, others seem to be unaffected HOT 6
- Add default binding for `git pull`
- Crash when mixing `key` / `keys` and using `whichkey.sortOrder` HOT 2
- [bug/ feature?]: whichkey.searchBindings should support fuzzy search HOT 2
- [Help Wanted] Show the menu when press g HOT 3
- Debug Transient State gets closed. HOT 4
- Support several menus HOT 4
- Space keybind with vscode-neovim and the Commands option HOT 5
- `bindings` vs `bindingOverrides` and `keys` vs `key` HOT 3
- Ability to specify font for menu "keys" HOT 6
- Typos in commands
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-which-key.