mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
Fix hotkeys registration under Windows
This commit is contained in:
parent
30763a2d03
commit
fa6a856ed5
|
@ -69,8 +69,11 @@ HotkeyStruct::HotkeyStruct( quint32 key_, quint32 key2_, quint32 modifier_,
|
||||||
HotkeyWrapper::HotkeyWrapper(QObject *parent) : QThread( parent ),
|
HotkeyWrapper::HotkeyWrapper(QObject *parent) : QThread( parent ),
|
||||||
state2(false)
|
state2(false)
|
||||||
{
|
{
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
hwnd=(HWND)((static_cast<QMainWindow*>(parent))->winId());
|
||||||
|
#else
|
||||||
init();
|
init();
|
||||||
|
#endif
|
||||||
(static_cast<QHotkeyApplication*>(qApp))->registerWrapper(this);
|
(static_cast<QHotkeyApplication*>(qApp))->registerWrapper(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,6 +185,8 @@ bool HotkeyWrapper::setGlobalKey( int key, int key2,
|
||||||
return false; // We don't monitor empty combinations
|
return false; // We don't monitor empty combinations
|
||||||
|
|
||||||
static int id = 0;
|
static int id = 0;
|
||||||
|
if( id > 0xBFFF - 1 )
|
||||||
|
id = 0;
|
||||||
|
|
||||||
quint32 mod = 0;
|
quint32 mod = 0;
|
||||||
if (modifier & Qt::CTRL)
|
if (modifier & Qt::CTRL)
|
||||||
|
|
Loading…
Reference in a new issue