Giter Club home page Giter Club logo

Comments (6)

theol0403 avatar theol0403 commented on July 3, 2024 1

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.

stevenguh avatar stevenguh commented on July 3, 2024

It is possible. See use-non-character-keys. As an example, for SPC w <right>:

  1. 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"
}
  1. Add the following overrides to your user's settings.json so we have a entry that maps to SPC 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.

theol0403 avatar theol0403 commented on July 3, 2024

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.

stevenguh avatar stevenguh commented on July 3, 2024

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.

theol0403 avatar theol0403 commented on July 3, 2024

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.

stevenguh avatar stevenguh commented on July 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.