From a028191c82817971aa30ad9731cf671e563a9988 Mon Sep 17 00:00:00 2001 From: True Zhuanjia Date: Sat, 24 Aug 2024 23:46:04 +0800 Subject: [PATCH] make keyboard command delay 200ms --- Limelight/Input/CommandManager.swift | 2 +- Limelight/Input/OnScreenButtonView.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Limelight/Input/CommandManager.swift b/Limelight/Input/CommandManager.swift index 22bda00e..10cf2de4 100644 --- a/Limelight/Input/CommandManager.swift +++ b/Limelight/Input/CommandManager.swift @@ -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) diff --git a/Limelight/Input/OnScreenButtonView.swift b/Limelight/Input/OnScreenButtonView.swift index 4fdea998..9a3358de 100644 --- a/Limelight/Input/OnScreenButtonView.swift +++ b/Limelight/Input/OnScreenButtonView.swift @@ -106,6 +106,7 @@ import UIKit // Touch event handling override func touchesBegan(_ touches: Set, 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)!