How to know if the keyboard is active on a text input

前端 未结 4 998
予麋鹿
予麋鹿 2021-01-23 07:57

I have an application that acts like an on screen keyboard, I need it to know if there is a keyboard cursor (caret) active any where, so the keyboard will set to active.

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-23 08:12

    Bit of a workaround, but if you can subscribe to a OnFocusChange event in your environment then you can check the type of control that newly received focus. Depending on if it is a 'keyboardable' type (or is derived from a 'keyboardable' type) you can display or hide your onscreen keyboard.

提交回复
热议问题