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

一世执手 提交于 2019-11-30 01:39:02

问题


Is it possible to assign a global hotkey to a specific feature in an Adobe AIR app, i.e. the app feature responds to the hotkey whether the app is active or not (it must be running of course, but only in the system tray).


回答1:


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.




回答2:


From the Reference Manual:

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




回答3:


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.



来源:https://stackoverflow.com/questions/153581/can-i-assign-a-global-hotkey-to-an-adobe-air-app

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