iOS: remove some unused code, minor code style cleanup.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m
index 17221eb..d45ac06 100644
--- a/src/video/uikit/SDL_uikitviewcontroller.m
+++ b/src/video/uikit/SDL_uikitviewcontroller.m
@@ -286,7 +286,8 @@ SDL_HideHomeIndicatorHintChanged(void *userdata, const char *name, const char *o
[center addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:nil];
}
-- (NSArray *) keyCommands {
+- (NSArray *)keyCommands
+{
NSMutableArray *commands = [[NSMutableArray alloc] init];
[commands addObject:[UIKeyCommand keyCommandWithInput:UIKeyInputUpArrow modifierFlags:kNilOptions action:@selector(handleCommand:)]];
[commands addObject:[UIKeyCommand keyCommandWithInput:UIKeyInputDownArrow modifierFlags:kNilOptions action:@selector(handleCommand:)]];
@@ -296,18 +297,20 @@ SDL_HideHomeIndicatorHintChanged(void *userdata, const char *name, const char *o
return [NSArray arrayWithArray:commands];
}
-- (void) handleCommand: (UIKeyCommand *) keyCommand {
+- (void)handleCommand:(UIKeyCommand *)keyCommand
+{
SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;
+ NSString *input = keyCommand.input;
- if (keyCommand.input == UIKeyInputUpArrow) {
+ if (input == UIKeyInputUpArrow) {
scancode = SDL_SCANCODE_UP;
- } else if (keyCommand.input == UIKeyInputDownArrow) {
+ } else if (input == UIKeyInputDownArrow) {
scancode = SDL_SCANCODE_DOWN;
- } else if (keyCommand.input == UIKeyInputLeftArrow) {
+ } else if (input == UIKeyInputLeftArrow) {
scancode = SDL_SCANCODE_LEFT;
- } else if (keyCommand.input == UIKeyInputRightArrow) {
+ } else if (input == UIKeyInputRightArrow) {
scancode = SDL_SCANCODE_RIGHT;
- } else if (keyCommand.input == UIKeyInputEscape) {
+ } else if (input == UIKeyInputEscape) {
scancode = SDL_SCANCODE_ESCAPE;
}
@@ -317,10 +320,6 @@ SDL_HideHomeIndicatorHintChanged(void *userdata, const char *name, const char *o
}
}
-- (void) downArrow: (UIKeyCommand *) keyCommand {
- NSLog(@"down arrow!");
-}
-
- (void)setView:(UIView *)view
{
[super setView:view];