mirror of
https://github.com/Skycoder42/QHotkey.git
synced 2026-11-19 12:49:58 +03:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0678c4cfc | ||
|
|
cdb4d37453 | ||
|
|
9eace8fbbd | ||
|
|
6baf644b40 | ||
|
|
3fa176a380 | ||
|
|
7c4ef6a03a | ||
|
|
15e34a7dbf | ||
|
|
b8f32c3381 | ||
|
|
10d1e44b21 |
@@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="playTab">
|
||||
<attribute name="title">
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
#include "hottestwidget.h"
|
||||
#include <QApplication>
|
||||
|
||||
//#define START_BACKGROUND
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
HotTestWidget w;
|
||||
|
||||
#ifdef START_BACKGROUND
|
||||
auto startKey = new QHotkey(QKeySequence(Qt::MetaModifier | Qt::ControlModifier | Qt::Key_S), true, &w);
|
||||
QObject::connect(startKey, &QHotkey::activated,
|
||||
&w, &QWidget::show);
|
||||
#else
|
||||
w.show();
|
||||
#endif
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ bool QHotkeyPrivateX11::registerShortcut(QHotkey::NativeShortcut shortcut)
|
||||
GrabModeAsync,
|
||||
GrabModeAsync);
|
||||
}
|
||||
XFlush(display);
|
||||
|
||||
if(errorHandler.hasError) {
|
||||
qCWarning(logQHotkey) << "Failed to register hotkey. Error:"
|
||||
@@ -129,6 +130,7 @@ bool QHotkeyPrivateX11::unregisterShortcut(QHotkey::NativeShortcut shortcut)
|
||||
shortcut.modifier | specialMod,
|
||||
DefaultRootWindow(display));
|
||||
}
|
||||
XFlush(display);
|
||||
|
||||
if(errorHandler.hasError) {
|
||||
qCWarning(logQHotkey) << "Failed to unregister hotkey. Error:"
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ mac {
|
||||
LIBS += -framework Carbon
|
||||
} else:win32 {
|
||||
SOURCES += $$PWD/QHotkey/qhotkey_win.cpp
|
||||
LIBS += -lUser32
|
||||
LIBS += -luser32
|
||||
} else:unix {
|
||||
SOURCES += $$PWD/QHotkey/qhotkey_x11.cpp
|
||||
QT += x11extras
|
||||
|
||||
Reference in New Issue
Block a user