开发者

how to get the CAPS LOCK (pressed Shift key) key state programmatically on IOS SDK?

开发者 https://www.devze.com 2023-03-02 05:53 出处:网络
I\'m writing custom text editor with specific chars (non-english). I know about property - autocapitalizationType to change capital, but before to view开发者_StackOverflow中文版ing (changing) of char

I'm writing custom text editor with specific chars (non-english).

I know about property - autocapitalizationType to change capital, but before to view开发者_StackOverflow中文版ing (changing) of char i NEED TO know about state of current keyboard.

And how to get the CAPS LOCK (pressed Shift key) key state of keyboard programmatically on IOS 4.0 SDK?


As of the moment, there is no way to enable CAPs lock on the keyboard simply because you can't touch/modify Apple's APIs. The only states you can receive from their keyboard are:

UIKeyboardWillShowNotification
UIKeyboardDidShowNotification
UIKeyboardWillHideNotification
UIKeyboardDidHideNotification

The only way you can do something like that is to create your own keyboard class or find a custom implementation online. Good luck!


Try this

self.yourTexField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;
0

精彩评论

暂无评论...
验证码 换一张
取 消