How can I add an extra character when long pressing a key on the virtual keyboard like in the following image:
I am using this library.
How can I add an extra character when long pressing a key on the virtual keyboard like in the following image:
I am using this library.
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.