mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-14 13:33:42 +00:00
Attempts to add conditional include for non-Mac UNIX only.
This commit is contained in:
parent
2230ac6c38
commit
0763ae38dd
@ -1,4 +1,10 @@
|
||||
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
|
||||
|
||||
|
@ -765,6 +765,12 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
|
||||
#include <QX11Info>
|
||||
|
||||
#endif
|
||||
|
||||
bool MainWindow::processEvent(QKeyEvent *event) {
|
||||
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
|
||||
// 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 BIND(key) BIND2(Key_##key, key)
|
||||
|
Loading…
x
Reference in New Issue
Block a user