From 367a5ec9f9f1623bcb2761682066b9d52c4fd41e Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 21 Aug 2018 06:07:13 +0200 Subject: HeadphoneKey: Rename `maybeRunAction` to `runAction` As alluded to in 8b94ca51e7ef431c476d1c500f36157a976186f0, since we cancel the `performSelector` in `handleDeadKey:`, this method doesn't "maybe" anything, it should always run the action. --- DomeKey/HeadphoneKey.h | 2 +- DomeKey/HeadphoneKey.m | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DomeKey/HeadphoneKey.h b/DomeKey/HeadphoneKey.h index c1b8e85..59c2b49 100644 --- a/DomeKey/HeadphoneKey.h +++ b/DomeKey/HeadphoneKey.h @@ -28,6 +28,6 @@ static const unsigned int TIMEOUT_MILLISECONDS = 1000; } - (void)handleDeadKey:(HeadphoneButton)button; -- (void)maybeRunAction; +- (void)runAction; @end diff --git a/DomeKey/HeadphoneKey.m b/DomeKey/HeadphoneKey.m index d5fdb8d..1d815b2 100644 --- a/DomeKey/HeadphoneKey.m +++ b/DomeKey/HeadphoneKey.m @@ -54,16 +54,16 @@ [_key_buffer addObject:storable_button]; [NSObject cancelPreviousPerformRequestsWithTarget:self - selector:@selector(maybeRunAction) + selector:@selector(runAction) object:nil]; NSTimeInterval timeout_seconds = TIMEOUT_MILLISECONDS / 1000.0; - [self performSelector:@selector(maybeRunAction) + [self performSelector:@selector(runAction) withObject:nil afterDelay:timeout_seconds]; } -- (void)maybeRunAction +- (void)runAction { NSLog(@"%@", _key_buffer); -- cgit v1.2.3