From 16ad9788c27e9fb038aa650b19c2c9ac507a0e1d Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 26 Sep 2018 01:09:56 +0200 Subject: HeadphoneKey(runAction): Get rid of keyboard simulation Delete the code that simulates key presses from map actions. Also delete the mode saving code and the unused `cleanup` label. Simulating key presses is now handled by the Rust library using the 'autopilot' crate. It felt easier that way to handle all types of key presses. --- DomeKey/HeadphoneKey.m | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/DomeKey/HeadphoneKey.m b/DomeKey/HeadphoneKey.m index 44fd4e6..eff43c6 100644 --- a/DomeKey/HeadphoneKey.m +++ b/DomeKey/HeadphoneKey.m @@ -83,29 +83,6 @@ const CKeyActionResult *result = c_run_key_action(_state, trigger, _in_mode); -// if ([self maybeSwitchToMode:result]) { -// goto cleanup; -// } - - if (result->kind) { - if (*result->kind == ActionKind_Map) { - const char *c = result->action; - int i = 0; - while (*c) { - [KeyboardSimulator simpleKeyPressWithKey:result->action[i]]; - i++; - *c++; - } - } - else if (*result->kind == ActionKind_Mode) { -// [self maybeSwitchToMode:result]; - // _in_mode = malloc(sizeof(Trigger)) - // *_in_mode = *result->in_mode; -// memcpy(_in_mode, result->in_mode, sizeof(const Trigger)); - } - } - -cleanup: [_key_buffer removeAllObjects]; } -- cgit v1.2.3