Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to detect the current keyboard input method on the iPhone?

I want to know the current input method the user is typing in such as En (english), German, Chinese, etc... Maybe keyboard type is what I am after, but documentation seems limited on this subject from Apple doc.

Thank you!

Managing the iPhone Keyboard http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html

like image 764
Unikorn Avatar asked Oct 05 '10 02:10

Unikorn


2 Answers

In iOS4.2 there is a new class UITextInputMode that is exactly what you want. (Oops, this is still under NDA. If you have no iOS dev center account please don't read this answer ;) )

You can query current mode (English, French, Japanese, etc) or get notifications when it changes (the keyboard language changes)

UITextInputMode documentation (requires log in)

like image 69
nacho4d Avatar answered Sep 24 '22 06:09

nacho4d


currentInputMode is deprecated since iOS7, be careful.

currentInputMode

Returns an instance representing the current text-input mode. (Deprecated in iOS 7.0.)

like image 30
Nikita Pestrov Avatar answered Sep 21 '22 06:09

Nikita Pestrov