diff options
-rw-r--r-- | DomeKey/HeadphoneKey.h | 2 | ||||
-rw-r--r-- | DomeKey/HeadphoneKey.m | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/DomeKey/HeadphoneKey.h b/DomeKey/HeadphoneKey.h index 22e7238..cad78ab 100644 --- a/DomeKey/HeadphoneKey.h +++ b/DomeKey/HeadphoneKey.h @@ -22,9 +22,11 @@ static const unsigned int TIMEOUT_MILLISECONDS = 1000; @interface HeadphoneKey : NSObject { NSArray *_mikeys; NSMutableArray *_key_buffer; + const Trigger *_in_mode; } - (void)handleDeadKey:(HeadphoneButton)button; - (void)runAction; +- (const Trigger *)maybeSwitchToMode:(const CKeyActionResult *)result; @end diff --git a/DomeKey/HeadphoneKey.m b/DomeKey/HeadphoneKey.m index b6d783e..b55c171 100644 --- a/DomeKey/HeadphoneKey.m +++ b/DomeKey/HeadphoneKey.m @@ -95,4 +95,17 @@ [_key_buffer removeAllObjects]; } +- (const Trigger *)maybeSwitchToMode:(const CKeyActionResult *)result +{ + // if _in_mode is not null, nullify it + // TODO: rename this method + + if (result->kind && + *result->kind == ActionKind_Mode) { + _in_mode = result->in_mode; + } + + return _in_mode; +} + @end |