本文介紹了C++/Qt 全局熱鍵的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在開發(fā)一個應用程序,我需要在后臺運行該應用程序,并在按下某個按鈕組合時運行一個功能.我有點理解這需要特定于平臺的 API 調(diào)用(WIN32、X11 等),但我真的不知道如何開始.另外,有沒有一種多平臺的方式來實現(xiàn)這一目標?我真的需要它在 Windows、Linux 和 OSX 上運行.
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.
推薦答案
總結:
- Qt 事件系統(tǒng) 可能是一個選項(在系統(tǒng)上有一些幫助/桌面管理員級別)
- Qxt 庫(不再維護)
- 或者這個項目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. 目前看來是最好的選擇.雖然不再維護,但目前可與 Qt5 配合使用.
. 2. seems the best option so far. Though it is not longer maintained it currently works with Qt5.
這篇關于C++/Qt 全局熱鍵的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!