問(wèn)題描述
我正在開(kāi)發(fā)一個(gè)應(yīng)用程序,我需要在后臺(tái)運(yùn)行該應(yīng)用程序,并在按下某個(gè)按鈕組合時(shí)運(yùn)行一個(gè)功能.我有點(diǎn)理解這需要特定于平臺(tái)的 API 調(diào)用(WIN32、X11 等),但我真的不知道如何開(kāi)始.另外,有沒(méi)有一種多平臺(tái)的方式來(lái)實(shí)現(xiàn)這一目標(biāo)?我真的需要它在 Windows、Linux 和 OSX 上運(yùn)行.
I'm working on an application, which I need to run in the background and run a function when a certain combination of buttons is pressed. I kind of understand that this requires a platform-specific API call (WIN32, X11, etc.), but I don't really know how to start. Also, is there a multi-platform way to achieve this? I really need this to work on Windows, Linux, and OSX.
推薦答案
總結(jié):
- Qt 事件系統(tǒng) 可能是一個(gè)選項(xiàng)(在系統(tǒng)上有一些幫助/桌面管理員級(jí)別)
- Qxt 庫(kù)(不再維護(hù))
- 或者這個(gè)項(xiàng)目UGlobalHotkey
- The Qt Event System may be an option (with some help on system/desktop manager level)
- Qxt Library (not longer maintained)
- Or this project UGlobalHotkey
.2. 目前看來(lái)是最好的選擇.雖然不再維護(hù),但目前可與 Qt5 配合使用.
. 2. seems the best option so far. Though it is not longer maintained it currently works with Qt5.
這篇關(guān)于C++/Qt 全局熱鍵的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!