summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Gallet <clement.gallet@ens-lyon.org>2021-02-28 20:17:01 +0100
committerClement Gallet <clement.gallet@ens-lyon.org>2021-02-28 20:17:01 +0100
commit1405649cd842c8c42f563f2101404c100f2b39f2 (patch)
treef05e337fab937617e94826f0510ccefd55e47dcd
parentb1f64ebf893b7986fa1c5062ce1dedc0355f2854 (diff)
Fix querying focus appmacos
-rw-r--r--libTAS.xcodeproj/project.xcworkspace/xcuserdata/clement.xcuserdatad/UserInterfaceState.xcuserstatebin229437 -> 221347 bytes
-rw-r--r--src/program/GameEventsQuartz.mm6
-rw-r--r--src/program/ui/KeyPressedDialog.cpp6
3 files changed, 3 insertions, 9 deletions
diff --git a/libTAS.xcodeproj/project.xcworkspace/xcuserdata/clement.xcuserdatad/UserInterfaceState.xcuserstate b/libTAS.xcodeproj/project.xcworkspace/xcuserdata/clement.xcuserdatad/UserInterfaceState.xcuserstate
index 1f8f9dcf..9715d7d1 100644
--- a/libTAS.xcodeproj/project.xcworkspace/xcuserdata/clement.xcuserdatad/UserInterfaceState.xcuserstate
+++ b/libTAS.xcodeproj/project.xcworkspace/xcuserdata/clement.xcuserdatad/UserInterfaceState.xcuserstate
Binary files differ
diff --git a/src/program/GameEventsQuartz.mm b/src/program/GameEventsQuartz.mm
index 781b19cf..3f190510 100644
--- a/src/program/GameEventsQuartz.mm
+++ b/src/program/GameEventsQuartz.mm
@@ -66,13 +66,11 @@ static CGEventRef eventTapFunction(CGEventTapProxy proxy, CGEventType type, CGEv
/* Build modifiers */
CGEventFlags flags = CGEventGetFlags(event);
keysym_t modifiers = context->config.km->get_modifiers(flags);
-
/* Check if this keycode with or without modifiers is mapped to a hotkey */
int hk_type = -1;
keysym_t keysym = context->config.km->nativeToKeysym(keycode);
keysym_t keyWithMod = keysym | modifiers;
- std::cerr << "keysym " << keysym << std::endl;
if (context->config.km->hotkey_mapping.find(keyWithMod) != context->config.km->hotkey_mapping.end()) {
hk_type = context->config.km->hotkey_mapping[keyWithMod].type;
}
@@ -146,10 +144,10 @@ bool GameEventsQuartz::haveFocus(Context *context)
/* If not received game pid, returns false */
if (!context->game_pid)
return false;
-
+
/* Get game NSRunningApplication object */
if (!gameApp) {
- NSRunningApplication* gameApp = [NSRunningApplication runningApplicationWithProcessIdentifier:pid_t(context->game_pid)];
+ gameApp = [NSRunningApplication runningApplicationWithProcessIdentifier:context->game_pid];
if (!gameApp) {
std::cerr << "Could not get NSRunningApplication object from pid: " << context->game_pid << std::endl;
diff --git a/src/program/ui/KeyPressedDialog.cpp b/src/program/ui/KeyPressedDialog.cpp
index c7a819d2..4f0c93e1 100644
--- a/src/program/ui/KeyPressedDialog.cpp
+++ b/src/program/ui/KeyPressedDialog.cpp
@@ -20,7 +20,6 @@
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QLabel>
#include <QtGui/QKeyEvent>
-#include <iostream>
#include "KeyPressedDialog.h"
#include "qtutils.h"
@@ -41,13 +40,10 @@ KeyPressedDialog::KeyPressedDialog(Context* c, QWidget *parent) : QDialog(parent
void KeyPressedDialog::keyPressEvent(QKeyEvent * e)
{
int modifiers = 0;
- std::cerr << "Qt native key " << e->nativeVirtualKey() << std::endl;
if (withModifiers) {
/* We ignore a key press on a modifier key if we accept a mapping that
- * includes modifier keys
- */
-
+ * includes modifier keys */
if (context->config.km->is_modifier(e->nativeVirtualKey())) {
return QDialog::keyPressEvent(e);
}