make keyboard command delay 200ms
This commit is contained in:
1 parent
c6b27ad0e0
commit
a028191c82
2 files changed
+2
-2
No files matched your search
@@ -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 {
|
guard index < keyboardCmdStrings.count else {
|
||||||
for keyStr in keyboardCmdStrings {
|
for keyStr in keyboardCmdStrings {
|
||||||
LiSendKeyboardEvent(CommandManager.keyMappings[keyStr]!,Int8(KEY_ACTION_UP), 0)
|
LiSendKeyboardEvent(CommandManager.keyMappings[keyStr]!,Int8(KEY_ACTION_UP), 0)
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ import UIKit
|
|||||||
|
|
||||||
// Touch event handling
|
// Touch event handling
|
||||||
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
|
// print("touchDown: %f", CACurrentMediaTime())
|
||||||
self.pressed = true
|
self.pressed = true
|
||||||
super.touchesBegan(touches, with: event)
|
super.touchesBegan(touches, with: event)
|
||||||
//self.backgroundColor = UIColor(red: 0.0, green: 0.0, blue: 1.0, alpha: 0.7)
|
//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.backgroundColor = UIColor.systemBlue.withAlphaComponent(0.7)
|
||||||
self.buttonDownVisualEffect()
|
self.buttonDownVisualEffect()
|
||||||
self.layer.borderWidth = 0
|
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 the command(keystring contains "+", it's a multi-key command or a quick triggering key, rather than a physical button
|
||||||
if(self.keyString.contains("+")){
|
if(self.keyString.contains("+")){
|
||||||
let keyboardCmdStrings = CommandManager.shared.extractKeyStrings(from: self.keyString)!
|
let keyboardCmdStrings = CommandManager.shared.extractKeyStrings(from: self.keyString)!
|
||||||
|
|||||||
Reference in new issue
Block a user