Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Hotkey but not menu item. #7768

Closed
robcaa opened this issue May 7, 2014 · 1 comment
Closed

Hotkey but not menu item. #7768

robcaa opened this issue May 7, 2014 · 1 comment

Comments

@robcaa
Copy link

robcaa commented May 7, 2014

It would be nice if you could specify a hotkey, writing plugins that do not present it to the menu. I wrote a Delphi-style bookmarking plugin that contains the Ctrl+1..9 and Ctrl+Shift+1..9 keys can be used, but I think the menu corresponding unnecessary.

Here is the code:
registerCommandHandler("toshsharma.bookmarks.setbookmark1", "set #1", setBookmark1, "Ctrl-Shift-1");

And here is what I want:
registerCommandHandler("toshsharma.bookmarks.setbookmark1", "", setBookmark1, "Ctrl-Shift-1");

@peterflynn
Copy link
Member

@robcaa You can do this. You can either use KeyBindingManager.addBinding() to map a shortcut to a command, or (more common) you can specify a shortcut at the same time as you add a menu item. See https://github.com/adobe/brackets/wiki/How-to-write-extensions#adding-menu-items--keyboard-shortcuts or https://github.com/adobe/brackets/wiki/Simple-%22Hello-World%22-extension for examples.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants