Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone/iPad keyboard shortcuts?

There's an action in my program which users need to perform very frequently (potentially hundreds of times per session), and I'd like to add a keyboard shortcut for users with a bluetooth keyboard. Is there any way to do this?

Right now, the closest I've come is triggering the action whenever the U+F8FF character is entered (Shift+Alt+k on an iPad/iPhone/Mac, which prints an apple logo character) in a text view. Of course, this would present an issue if the user actually wanted to input an apple symbol.

Are there any better ways to support keyboard shortcuts (hopefully Cmd+something, rather than Shift+Alt+something)? Thanks!

like image 988
igul222 Avatar asked Jul 07 '10 23:07

igul222


People also ask

Can you use keyboard shortcuts on an iPad?

You can use the Shortcuts bar (at the bottom of the screen) and combination keystrokes known as keyboard shortcuts to quickly perform many common actions.

Does iPhone have keyboard shortcuts?

To make a new shortcut, launch the Settings app —> General —> Keyboard —> Text Replacement and choose the “+” symbol in the top right corner. Enter the abbreviation you'd like to use in the “Shortcut” field, and then type in the entire phrase you want it to be replaced with in the “Phrase” field.


1 Answers

Under Cocoa for Mac OS X, you would gather modifier key information from the NSEvent passed to the keyDown: method in an NSResponder object. CocoaTouch replaces the NSResponder with UIResponder and NSEvent with UIEvent. The UI versions don't have documented keyboard event support. I'm guessing that Apple has extended UIResponder to handle keydown events, but hasn't publicly documented the changes yet. Unfortunately that means we'll just have to wait for that documentation to be able to read the modifier keys.

I think your current solution is a fine solution until Apple gives us a keyboard supporting UIResponder.

like image 138
Mr. Berna Avatar answered Sep 29 '22 21:09

Mr. Berna