make keyboard command delay 200ms

This commit is contained in:
True Zhuanjia
2024-08-24 23:46:04 +08:00
parent c6b27ad0e0
commit a028191c82
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -363,7 +363,7 @@ import UIKit
}
}
@objc public func sendKeyDownEventWithDelay(keyboardCmdStrings: [String], delay: TimeInterval = 0.05, index: Int = 0) {
@objc public func sendKeyDownEventWithDelay(keyboardCmdStrings: [String], delay: TimeInterval = 0.2, index: Int = 0) { // we need a large delay for WAN streaming
guard index < keyboardCmdStrings.count else {
for keyStr in keyboardCmdStrings {
LiSendKeyboardEvent(CommandManager.keyMappings[keyStr]!,Int8(KEY_ACTION_UP), 0)
+1 -1
View File
@@ -106,6 +106,7 @@ import UIKit
// Touch event handling
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
// print("touchDown: %f", CACurrentMediaTime())
self.pressed = true
super.touchesBegan(touches, with: event)
//self.backgroundColor = UIColor(red: 0.0, green: 0.0, blue: 1.0, alpha: 0.7)
@@ -114,7 +115,6 @@ import UIKit
// self.backgroundColor = UIColor.systemBlue.withAlphaComponent(0.7)
self.buttonDownVisualEffect()
self.layer.borderWidth = 0
// if the command(keystring contains "+", it's a multi-key command or a quick triggering key, rather than a physical button
if(self.keyString.contains("+")){
let keyboardCmdStrings = CommandManager.shared.extractKeyStrings(from: self.keyString)!