mirror of
https://github.com/Skycoder42/QHotkey.git
synced 2026-11-19 12:49:58 +03:00
... and x11
This commit is contained in:
@@ -11,8 +11,8 @@ HotTestWidget::HotTestWidget(QWidget *parent) :
|
|||||||
hotkey_5(new QHotkey(NULL)),
|
hotkey_5(new QHotkey(NULL)),
|
||||||
thread4(new QThread(this)),
|
thread4(new QThread(this)),
|
||||||
thread5(new QThread(this)),
|
thread5(new QThread(this)),
|
||||||
nativeHotkey(new QHotkey(this)),
|
testHotkeys(),
|
||||||
testHotkeys()
|
nativeHotkey(new QHotkey(this))
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->thread4->start();
|
this->thread4->start();
|
||||||
|
|||||||
@@ -973,7 +973,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="label_8">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p>QHotkey allows you to set native shortcuts explicitly. These, of course, only work on the platform they were choosen for. All platform use special constants for their key codes and modifiers, which makes it pretty simple to use them from code. If you want to test them out here, google for the tables.</p><p>In most cases, you will not need to specify native shortcuts directly. However, as explaind on previos tabs, some shotcuts may not be creatable from Qt's key (e.g. Numblock numbers). In that case, you can set the directly.</p><p><span style=" text-decoration: underline;">Example: Ctrl+A</span></p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Windows:</span> Key: <span style=" font-style:italic;">0x0041</span>, Modifier: <span style=" font-style:italic;">0x0002</span></li><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">X11:</span> Key: <span style=" font-style:italic;">0x001E</span>, Modifier: <span style=" font-style:italic;">0x0002</span></li><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">OsX:</span> Key: <span style=" font-style:italic;">0x0000</span>, Modifier: <span style=" font-style:italic;">0x0100</span><span style=" text-decoration: underline;"><br/></span></li></ul></body></html></string>
|
<string><html><head/><body><p>QHotkey allows you to set native shortcuts explicitly. These, of course, only work on the platform they were choosen for. All platform use special constants for their key codes and modifiers, which makes it pretty simple to use them from code. If you want to test them out here, google for the tables.</p><p>In most cases, you will not need to specify native shortcuts directly. However, as explaind on previos tabs, some shotcuts may not be creatable from Qt's key (e.g. Numblock numbers). In that case, you can set the directly.</p><p><span style=" text-decoration: underline;">Example: Ctrl+A</span></p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Windows:</span> Key: <span style=" font-style:italic;">0x0041</span>, Modifier: <span style=" font-style:italic;">0x0002</span></li><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">X11:</span> Key: <span style=" font-style:italic;">0x0026</span>, Modifier: <span style=" font-style:italic;">0x0004</span></li><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">OsX:</span> Key: <span style=" font-style:italic;">0x0000</span>, Modifier: <span style=" font-style:italic;">0x0100</span><span style=" text-decoration: underline;"><br/></span></li></ul></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ bool QHotkeyPrivateX11::registerShortcut(QHotkey::NativeShortcut shortcut)
|
|||||||
HotkeyErrorHandler errorHandler;
|
HotkeyErrorHandler errorHandler;
|
||||||
for(quint32 specialMod : QHotkeyPrivateX11::specialModifiers) {
|
for(quint32 specialMod : QHotkeyPrivateX11::specialModifiers) {
|
||||||
XGrabKey(display,
|
XGrabKey(display,
|
||||||
shortcut.first,
|
shortcut.key,
|
||||||
shortcut.second | specialMod,
|
shortcut.modifier | specialMod,
|
||||||
DefaultRootWindow(display),
|
DefaultRootWindow(display),
|
||||||
True,
|
True,
|
||||||
GrabModeAsync,
|
GrabModeAsync,
|
||||||
@@ -125,8 +125,8 @@ bool QHotkeyPrivateX11::unregisterShortcut(QHotkey::NativeShortcut shortcut)
|
|||||||
HotkeyErrorHandler errorHandler;
|
HotkeyErrorHandler errorHandler;
|
||||||
for(quint32 specialMod : QHotkeyPrivateX11::specialModifiers) {
|
for(quint32 specialMod : QHotkeyPrivateX11::specialModifiers) {
|
||||||
XUngrabKey(display,
|
XUngrabKey(display,
|
||||||
shortcut.first,
|
shortcut.key,
|
||||||
shortcut.second | specialMod,
|
shortcut.modifier | specialMod,
|
||||||
DefaultRootWindow(display));
|
DefaultRootWindow(display));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user