MacGapProject / MacGap1

Desktop WebKit wrapper for HTML/CSS/JS applications.
Other
3.55k stars 208 forks source link

Add global keyboard shortcuts (Hotkeys) #17

Closed hay closed 12 years ago

hay commented 12 years ago

It would be great to have a way to add global window shortcuts, for example to add global play/pause to a music application.

Maybe something like:

macgap.menu.addHotKey("cmd-alt-p", function() { window.App.pauseSound(); });

maccman commented 12 years ago

You can do this with JavaScript, right?

hay commented 12 years ago

Add global shortcuts to the application while it is not in focus?

maccman commented 12 years ago

That's against OS UI guidelines.

hay commented 12 years ago

I'm not quite sure what you mean. For example, the official Twitter client has a global shortcut that allows me to post messages, or a tool like Quicksilver allows me to get the command window from everywhere by pressing Cmd-Space.

maccman commented 12 years ago

Ah I see. Nope, I don't that'll get in. You're quite welcome to fork though.

natew commented 12 years ago

Any reason why you don't think this will get in?

For music website this is a huge benefit, being able to use media keys to control the music player!

(think grooveshark, etc)

I'm a web developer and complete noob to mac development but have a music site I'm development. I'm going to ask a cocoa developer buddy to see if he can't get this working. I think it should be reconsidered for the roadmap, or in other words, +1

blakewilson commented 5 years ago

Has the decision for this feature changed at all since 2012?

jeff-h commented 5 years ago

If a PR was offered in https://github.com/MacGapProject/MacGap2 I would roll it in. I think it would add something valuable to the kinds of apps likely built with MacGap.