mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-19 14:25:35 +00:00
Attempts to add conditional include for non-Mac UNIX only.
This commit is contained in:
parent
2230ac6c38
commit
0763ae38dd
@ -1,5 +1,11 @@
|
|||||||
QT += core gui multimedia widgets
|
QT += core gui multimedia widgets
|
||||||
|
|
||||||
|
unix:!mac {
|
||||||
|
# For non-Mac UNIX targets, include X11 extras to check for X11.
|
||||||
|
# x11extras isn't supported on the Mac.
|
||||||
|
QT += x11extras
|
||||||
|
}
|
||||||
|
|
||||||
CONFIG += c++17
|
CONFIG += c++17
|
||||||
|
|
||||||
# Permit multiple source files in different directories to have the same file name.
|
# Permit multiple source files in different directories to have the same file name.
|
||||||
|
@ -765,6 +765,12 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event) {
|
|||||||
processEvent(event);
|
processEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||||
|
|
||||||
|
#include <QX11Info>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
bool MainWindow::processEvent(QKeyEvent *event) {
|
bool MainWindow::processEvent(QKeyEvent *event) {
|
||||||
if(!machine) return true;
|
if(!machine) return true;
|
||||||
|
|
||||||
@ -797,10 +803,9 @@ bool MainWindow::processEvent(QKeyEvent *event) {
|
|||||||
//
|
//
|
||||||
// You can't. Qt is the worst. SDL doesn't have this problem, including in X11, so this seems to be a problem
|
// You can't. Qt is the worst. SDL doesn't have this problem, including in X11, so this seems to be a problem
|
||||||
// Qt has invented for itself.
|
// Qt has invented for itself.
|
||||||
//
|
|
||||||
// TODO: find a workaround. Platform-specific use of either nativeScanCode() or nativeVirtualKey() maybe,
|
|
||||||
// but if so, how to interpret the meaning?
|
|
||||||
|
|
||||||
|
// Workaround for X11: assume
|
||||||
|
// QX11Info::isPlatformX11();
|
||||||
|
|
||||||
#define BIND2(qtKey, clkKey) case Qt::qtKey: key = Inputs::Keyboard::Key::clkKey; break;
|
#define BIND2(qtKey, clkKey) case Qt::qtKey: key = Inputs::Keyboard::Key::clkKey; break;
|
||||||
#define BIND(key) BIND2(Key_##key, key)
|
#define BIND(key) BIND2(Key_##key, key)
|
||||||
|
Loading…
Reference in New Issue
Block a user