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

前端 未结 2 1698
傲寒
傲寒 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: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!

提交回复
热议问题