react-native-keyevent icon indicating copy to clipboard operation
react-native-keyevent copied to clipboard

on iOS arrow key events are not fired unless shift is held down

Open mcraigie opened this issue 4 years ago • 2 comments

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!

mcraigie avatar Jan 30 '21 22:01 mcraigie

Ran into the same issue with the number-keys, thank you for this workaround.

zzorba avatar Sep 20 '21 16:09 zzorba