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

前端 未结 2 1696
傲寒
傲寒 2020-12-07 05:20

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

I know about property - autocapitalizationType to change capital, but before to viewing (changing)

相关标签:
2条回答
  • 2020-12-07 05:33

    Try this

    self.yourTexField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;
    
    0 讨论(0)
  • 2020-12-07 05:46

    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!

    0 讨论(0)
提交回复
热议问题