feat: mac enable keymap

This commit is contained in:
rankun 2020-02-26 16:33:43 +08:00 committed by Barry
parent e975e22325
commit 44e97e5591
3 changed files with 12 additions and 2 deletions

View file

@ -48,6 +48,10 @@ int main(int argc, char *argv[])
qputenv("QTSCRCPY_CONFIG_PATH", "../../../../config");
#endif
#ifdef Q_OS_OSX
qputenv("QTSCRCPY_KEYMAP_PATH", "../../../../../../keymap");
#endif
#ifdef Q_OS_LINUX
qputenv("QTSCRCPY_ADB_PATH", "../../../third_party/adb/linux/adb");
qputenv("QTSCRCPY_SERVER_PATH", "../../../third_party/scrcpy-server");

View file

@ -28,6 +28,8 @@
<string>1.2.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.10</string>
<key>NSAppleEventsUsageDescription</key>
<string>play game need this</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2018-2038 rankun. All rights reserved.</string>
<key>NSMainStoryboardFile</key>

View file

@ -62,10 +62,14 @@ static CGEventRef Cocoa_MouseTapCallback(CGEventTapProxy proxy, CGEventType type
eventLocation = CGEventGetUnflippedLocation(event);
windowRect = [nswindow contentRectForFrameRect:[nswindow frame]];
windowRect.origin.x += 100;
windowRect.origin.y += 30;
windowRect.size.width -= 180;
windowRect.size.height -= 60;
newWindowRect = NSMakeRect(windowRect.origin.x, windowRect.origin.y,
windowRect.size.width - 10, windowRect.size.height - 10);
qDebug() << newWindowRect.origin.x << newWindowRect.origin.y
<< newWindowRect.size.width << newWindowRect.size.height;
//qDebug() << newWindowRect.origin.x << newWindowRect.origin.y << newWindowRect.size.width << newWindowRect.size.height;
if (!NSMouseInRect(NSPointFromCGPoint(eventLocation), newWindowRect, NO)) {