sending keyboard cmd
This commit is contained in:
1 parent
81beb35809
commit
c8262da5d7
1 file changed
+13
-5
@@ -244,17 +244,25 @@ import UIKit
|
|||||||
|
|
||||||
if !isEditingMode {
|
if !isEditingMode {
|
||||||
// Call the dummy method for key-value sending implementation
|
// Call the dummy method for key-value sending implementation
|
||||||
sendKeyboardCommand()
|
let command = CommandManager.shared.getAllCommands()[indexPath.row]
|
||||||
|
sendKeyboardCommand(command)
|
||||||
dismiss(animated: false, completion: nil) // dimiss the view in sending mode
|
dismiss(animated: false, completion: nil) // dimiss the view in sending mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func sendKeyboardCommand() {
|
private func sendKeyboardCommand(_ cmd: RemoteCommand) {
|
||||||
// Dummy implementation
|
// Dummy implementation
|
||||||
print("Sending key-value")
|
print("Sending key-value")
|
||||||
LiSendKeyboardEvent(CommandManager.keyMappings["WIN"]!,Int8(KEY_ACTION_DOWN), 0)
|
|
||||||
Thread.sleep(forTimeInterval: 0.05)
|
let keyboardCmdStrings = CommandManager.shared.extractKeyStrings(from: cmd.keyboardCmdString)
|
||||||
LiSendKeyboardEvent(CommandManager.keyMappings["WIN"]!,Int8(KEY_ACTION_UP), 0)
|
for keyStr in keyboardCmdStrings! {
|
||||||
|
LiSendKeyboardEvent(CommandManager.keyMappings[keyStr]!,Int8(KEY_ACTION_DOWN), 0)
|
||||||
|
print("keycode: \(CommandManager.keyMappings[keyStr] ?? 0xFF)")
|
||||||
|
Thread.sleep(forTimeInterval: 0.05)
|
||||||
|
}
|
||||||
|
for keyStr in keyboardCmdStrings! {
|
||||||
|
LiSendKeyboardEvent(CommandManager.keyMappings[keyStr]!,Int8(KEY_ACTION_UP), 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user