开发者

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 somethin开发者_开发问答g 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜