禁用应用程序的全键盘访问 [英] Disable Full Keyboard Access for App

查看:181
本文介绍了禁用应用程序的全键盘访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用某些API控制全键盘访问(系统预设 - >键盘 - >(无线电)所有控制)吗?它会导致主要问题时,这个东西在我的应用程序(如按钮不工作像预期等...它有一些自定义UI)

Can "Full Keyboard Access" (System Prefs -> Keyboard -> (Radio) All Controls) be controlled with some API? It causes major issues when this thing is on in my app (like buttons not working as expected etc ... it has some custom UI)

问候,
Erik

Regards, Erik

推荐答案

覆盖 nextValidKeyView previousValidKeyView 在您的自定义视图中返回一些sane,或设置视图的 nextKeyView previousKeyView

Override nextValidKeyView and previousValidKeyView in your custom view to return something sane, or set the view's nextKeyView and previousKeyView to specific views if detecting valid key views automatically isn't possible.

如果全键盘访问无法正确导航您的应用程序,那么任何人都无法使用鼠标。此外,我们中的一些人真的很喜欢全键盘访问,并讨厌任何不能正常工作或故意打破它的应用程序(从用户的角度来看,没有区别)。

If Full Keyboard Access can't navigate your app correctly, then neither can anybody who can't use the mouse. Also, some of us really like Full Keyboard Access, and hate any app that either doesn't work properly under it or breaks it deliberately (and, from the user perspective, there is no difference).

这篇关于禁用应用程序的全键盘访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆