sensitivity tweak for direction touchpads (wasdpad, arrowpad, dpad)

This commit is contained in:
TrueZhuangjia authored and TrueZhuanjia committed 2025-03-24 01:24:15 +08:00
1 parent 9aa84c03d7
commit 7b116b936c
17 files changed
+39 -40

No files matched your search

+2 -2
View File
@@ -2,8 +2,8 @@
// KeyManager.swift // KeyManager.swift
// Moonlight-ZWM // Moonlight-ZWM
// //
// Created by ZWM on 2024/7/23. // Created by True砖家 on 2024/7/23.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
import Foundation import Foundation
+2 -2
View File
@@ -2,8 +2,8 @@
// CustomTapGestureRecognizer.h // CustomTapGestureRecognizer.h
// Moonlight // Moonlight
// //
// Created by ZWM on 2024/5/15. // Created by True砖家 on 2024/5/15.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
#ifndef CustomTapGestureRecognizer_h #ifndef CustomTapGestureRecognizer_h
+2 -2
View File
@@ -2,8 +2,8 @@
// CustomTapGestureRecognizer.m // CustomTapGestureRecognizer.m
// Moonlight // Moonlight
// //
// Created by ZWM on 2024/5/15. // Created by True砖家 on 2024/5/15.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
+2 -2
View File
@@ -2,8 +2,8 @@
// NativeTouchHandler.h // NativeTouchHandler.h
// Moonlight // Moonlight
// //
// Created by ZWM on 2024/6/16. // Created by True砖家 on 2024/6/16.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
+2 -2
View File
@@ -2,8 +2,8 @@
// NativeTouchHandler.m // NativeTouchHandler.m
// Moonlight // Moonlight
// //
// Created by ZWM on 2024/6/16. // Created by True砖家 on 2024/6/16.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
+2 -2
View File
@@ -2,8 +2,8 @@
// NativeTouchPointer.h // NativeTouchPointer.h
// Moonlight // Moonlight
// //
// Created by ZWM on 2024/5/14. // Created by True砖家 on 2024/5/14.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
#import "StreamView.h" #import "StreamView.h"
+2 -2
View File
@@ -2,8 +2,8 @@
// NativeTouchPointer.m // NativeTouchPointer.m
// Moonlight // Moonlight
// //
// Created by ZWM on 2024/5/14. // Created by True砖家 on 2024/5/14.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
+7 -7
View File
@@ -2,8 +2,8 @@
// OnScreenKey.swift // OnScreenKey.swift
// Moonlight-ZWM // Moonlight-ZWM
// //
// Created by ZWM on 2024/8/4. // Created by True砖家 on 2024/8/4.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
import UIKit import UIKit
@@ -149,9 +149,9 @@ import UIKit
self.touchPadString = touchPadString self.touchPadString = touchPadString
self.buttonString = self.comboButtonStrings.first ?? "" self.buttonString = self.comboButtonStrings.first ?? ""
let stickAndMouseTouchpads = ["LSPAD", "RSPAD", "LSVPAD", "RSVPAD", "MOUSEPAD"] // let stickAndMouseTouchpads = ["LSPAD", "RSPAD", "LSVPAD", "RSVPAD", "MOUSEPAD"]
let nonVectorStickPads = ["LSPAD", "RSPAD"] let nonVectorStickPads = ["LSPAD", "RSPAD"]
if stickAndMouseTouchpads.contains(self.touchPadString) {self.hasSensitivityTweak = true} if CommandManager.touchPadCmds.contains(self.touchPadString) {self.hasSensitivityTweak = true}
if nonVectorStickPads.contains(self.touchPadString) && widgetType == WidgetTypeEnum.touchPad {self.hasStickIndicator = true} if nonVectorStickPads.contains(self.touchPadString) && widgetType == WidgetTypeEnum.touchPad {self.hasStickIndicator = true}
switch self.cmdString { switch self.cmdString {
@@ -630,7 +630,7 @@ import UIKit
case down = 8 case down = 8
} }
let nearZeroPoint = abs(offSetX)<28 && abs(offSetY)<28 let nearZeroPoint = abs(offSetX) < 16/sensitivityFactor && abs(offSetY) < 16/sensitivityFactor
// NSLog("deltaX: %f, detalY: %f", deltaX, deltaY) // NSLog("deltaX: %f, detalY: %f", deltaX, deltaY)
var buttonPressed = 0; var buttonPressed = 0;
@@ -975,10 +975,10 @@ import UIKit
case "DPAD", "WASDPAD", "ARROWPAD": case "DPAD", "WASDPAD", "ARROWPAD":
self.lrudIndicatorBall = createAndShowLrudBall(at: touchBeganLocation) self.lrudIndicatorBall = createAndShowLrudBall(at: touchBeganLocation)
if quickDoubleTapDetected { if quickDoubleTapDetected {
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings[self.buttonString]!,Int8(KEY_ACTION_DOWN), 0) self.sendComboButtonsDownEvent(comboStrings: self.comboButtonStrings)
DispatchQueue.global(qos: .userInitiated).async { DispatchQueue.global(qos: .userInitiated).async {
usleep(100000) usleep(100000)
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings[self.buttonString]!,Int8(KEY_ACTION_UP), 0) self.sendComboButtonsUpEvent(comboStrings: self.comboButtonStrings)
} }
} }
default: default:
+2 -2
View File
@@ -2,8 +2,8 @@
// NativeTouchHandler.h // NativeTouchHandler.h
// Moonlight // Moonlight
// //
// Created by ZWM on 2024/6/16. // Created by True砖家 on 2024/6/16.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
+2 -2
View File
@@ -2,8 +2,8 @@
// NativeTouchHandler.m // NativeTouchHandler.m
// Moonlight // Moonlight
// //
// Created by ZWM on 2024/8/29. // Created by True砖家 on 2024/8/29.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
+2 -3
View File
@@ -2,9 +2,8 @@
// RelativeTouchHandler.m // RelativeTouchHandler.m
// Moonlight // Moonlight
// //
// Completely refactored by ZWM on 2024.9.13 // Completely refactored by True砖家 on 2024.9.13
// Created by Cameron Gutman on 11/1/20. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// Copyright © 2020 Moonlight Game Streaming Project. All rights reserved.
// //
#import "RelativeTouchHandler.h" #import "RelativeTouchHandler.h"
+2 -2
View File
@@ -2,8 +2,8 @@
// LocalizationHelper.h // LocalizationHelper.h
// Moonlight // Moonlight
// //
// Created by ZWM on 2024/6/30. // Created by True砖家 on 2024/6/30.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
#ifndef LocalizationHelper_h #ifndef LocalizationHelper_h
@@ -2,8 +2,8 @@
// SwiftLocalizationHelper.swift // SwiftLocalizationHelper.swift
// Moonlight-ZWM // Moonlight-ZWM
// //
// Created by ZWM on 2024/7/23. // Created by True砖家 on 2024/7/23.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © True砖家 on Bilibili. All rights reserved.
// //
import Foundation import Foundation
+2 -2
View File
@@ -2,8 +2,8 @@
// OrientationHelper.swift // OrientationHelper.swift
// Moonlight-ZWM // Moonlight-ZWM
// //
// Created by ZWM on 2024/7/12. // Created by True砖家 on 2024/7/12.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
@@ -2,8 +2,8 @@
// KeyManagerViewController.swift // KeyManagerViewController.swift
// Moonlight-ZWM // Moonlight-ZWM
// //
// Created by ZWM on 2024/7/23. // Created by True砖家 on 2024/7/23.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
import UIKit import UIKit
@@ -2,8 +2,8 @@
// CustomEdgeSlideGestureRecognizer.h // CustomEdgeSlideGestureRecognizer.h
// Moonlight-ZWM // Moonlight-ZWM
// //
// Created by ZWM on 2024/4/30. // Created by True砖家 on 2024/4/30.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
#ifndef CustomEdgeSlideGestureRecognizer_h #ifndef CustomEdgeSlideGestureRecognizer_h
@@ -2,8 +2,8 @@
// CustomEdgeSlideGestureRecognizer.m // CustomEdgeSlideGestureRecognizer.m
// Moonlight-ZWM // Moonlight-ZWM
// //
// Created by ZWM on 2024/4/30. // Created by True砖家 on 2024/4/30.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved. // Copyright © 2024 True砖家 on Bilibili. All rights reserved.
// //
// #import <Foundation/Foundation.h> // #import <Foundation/Foundation.h>