5

How can I add an extra character when long pressing a key on the virtual keyboard like in the following image:

add extra character on long press event like long press "n" button on keyboard

I am using this library.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
user3091160
  • 145
  • 2
  • 13

1 Answers1

1

Apple provides a well-explained programming guide for custom keyboards here.

According to that guide:

These features and others are listed next.

  • Appropriate layout and features based on keyboard type trait
  • Autocorrection and suggestion
  • Automatic capitalization
  • Automatic period upon double space
  • Caps lock support
  • Keycap artwork
  • Multistage input for ideographic languages

You can decide whether or not to implement such features; there is no dedicated API for any of the features just listed, so providing them is a competitive advantage.

Your keyword here is Keycap Artwork.

So, like they said, there is no dedicated api for this. You can design this with known, regular ways. Like, adding a tap gesture recognizer to letter buttons, and displaying some view includes extra characters to top-right edge of letter button when letter is long pressed.

Or alternatively, you can create a second keyboard contains your custom chars and let users switch between default keyboard and your one.

Update:

I also found this question. Those answers may help you to decide what to do.

Community
  • 1
  • 1
alioguzhan
  • 7,657
  • 10
  • 46
  • 67