react-native-keyevent
react-native-keyevent copied to clipboard
on iOS arrow key events are not fired unless shift is held down
It looks like this has something to do with the code in AppDelegate.m, but I don't know enough about the language at the moment to suggest a fix sorry.
As the arrow keys were all I wanted anyway I have just done this for now:
for (NSString* names in namesArray) {
NSRange range = [names rangeOfCharacterFromSet:validChars];
[keys addObject: [UIKeyCommand keyCommandWithInput:names modifierFlags:0 action:@selector(keyInput:)]];
// TODO: arrow keys not working unless shift modifier is held too
// if (NSNotFound != range.location) {
// [keys addObject: [UIKeyCommand keyCommandWithInput:names modifierFlags:UIKeyModifierShift action:@selector(keyInput:)]];
// } else {
// [keys addObject: [UIKeyCommand keyCommandWithInput:names modifierFlags:0 action:@selector(keyInput:)]];
// }
}
Thank-you for the library!
Ran into the same issue with the number-keys, thank you for this workaround.