Can I assign a global hotkey to an Adobe AIR app?

纵饮孤独 提交于 2019-11-30 17:52:39

I don't this it's possible with Adobe AIR itself. The only method I can think of:

  1. Install 3rd party hotkey application (like AutoHotkey or HotKeyBind)
  2. Configure hotkey application to make CTRL+ALT+Q to launch "c:\programs\thvo42\coolapp.exe --hotkey q"
  3. In your AIR application, register for the NativeApplication.invoke event, and watch for arguments like '--hotkey q' to know that the Q hotkey was pressed, and then act accordingly.

Of course, this is kind of a hassle, maybe with some hacking you can roll it all into a single install file.

From the Reference Manual:

To listen globally for key events, listen on the Stage for the capture and target or bubble phase.

SWFKit creates a wrapper around your flash/flex movie, and allows access to system DLLs and other goodies, but unfortunately it would export as an .exe, so windows only and no AIR.

ASFAIK, there is no support for it by using AIR alone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!