Steve Nay
Steve Nay

Reputation: 2829

Raising an event after a keypress

Aaron Frost's TweetPlus app has a useful feature in which the tweet functionality of the app lies dormant until the user presses Ctrl+Alt+T. At that time, a notify box pops up in the upper right corner to let the user tweet about the page they are on. I would like to do something similar.

Is there a way to use watch() to raise an event when the user presses a certain key combination?

Another possibility: Is there a way to raise an event directly with JavaScript, including sending event parameters? This way, I can set up a callback (perhaps using jQuery HotKeys) to raise the event.

Upvotes: 2

Views: 76

Answers (1)

frosty
frosty

Reputation: 21762

Steve, here is my answer. Let me know if there are questions or feedback? http://www.40win.com/2011/05/08/jskeyboardevents/

Upvotes: 3

Related Questions