Skip to content

Commit 8f79a25

Browse files
christophpurrerappden
authored andcommitted
Refactor handling of keyDown/keyUp (microsoft#1338)
This refactors / simplifies certain keyUp|Down event handling. It will make a later change (adding textInput handling for textInput fields) easier (to review) Co-authored-by: Scott Kyle <[email protected]> # Conflicts: # React/Views/RCTViewKeyboardEvent.m
1 parent 0840ba9 commit 8f79a25

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

React/Views/RCTViewKeyboardEvent.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ + (NSString *)keyFromEvent:(NSEvent *)event
5252
return @"Backspace";
5353
} else if (code == NSDeleteFunctionKey) {
5454
return @"Delete";
55-
} else if (code == NSHomeFunctionKey) {
56-
return @"Home";
57-
} else if (code == NSEndFunctionKey) {
58-
return @"End";
59-
} else if (code == NSPageUpFunctionKey) {
60-
return @"PageUp";
61-
} else if (code == NSPageDownFunctionKey) {
62-
return @"PageDown";
63-
}
55+
} else if (code == NSHomeFunctionKey) {
56+
return @"Home";
57+
} else if (code == NSEndFunctionKey) {
58+
return @"End";
59+
} else if (code == NSPageUpFunctionKey) {
60+
return @"PageUp";
61+
} else if (code == NSPageDownFunctionKey) {
62+
return @"PageDown";
63+
}
6464

6565
return key;
6666
}

0 commit comments

Comments
 (0)