Command, alt, control, tab keys in iOS 8 Custom keyboard

拈花ヽ惹草 提交于 2020-07-22 10:24:06

问题


I know that since iOS 7 it is possible to capture keyboard shortcuts in apps using the UIKeyCommand class.

Is it possible to implement the command, alt, control, tab keys in a custom keyboard to fire some keyboard shortcuts like copy, paste or some custom shortcuts defined within each app?

Maybe there is a way to simulate the input from the external keyboard forcing something with UIKeyCommand?


回答1:


Nope. Custom keyboards (that is, onscreen keyboards from the iOS 8 keyboard extension API) insert text, they don't send key events. And inserting text is all they can do — the API for custom keyboards is very narrowly defined... presumably for privacy/security reasons.

I know I wouldn't want a keyboard extension randomly performing UI actions in other apps without my involvement. But Apple might think differently if you can provide a good use case in a feature request...



来源:https://stackoverflow.com/questions/28634523/command-alt-control-tab-keys-in-ios-8-custom-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!