如何提供我的应用程序“辅助访问权限”一次“辅助设备的启用访问”已检查? [英] How do I give my app "assistive access privileges" once "Enable Access for Assistive Devices" has been checked?

查看:202
本文介绍了如何提供我的应用程序“辅助访问权限”一次“辅助设备的启用访问”已检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序使用一个(完全用户友好的)系统范围的键盘钩子用于辅助功能。

I have an app that uses a (perfectly user-benevolent) system-wide keyboard hook for accessibility purposes.

当应用程序启动时,根据其他人的要求,选中启用辅助设备的辅助功能设置:以编程方式确定为辅助设备启用访问在Cocoa应用程序中检查

When the app starts up, I check if the "Enable Access for Assistive Devices" setting is checked, as asked by someone else here: Programmatically determine if "enable access for assistive devices" is checked in Cocoa app

我的问题是,即使在通过复选框启用访问后,应用程序仍然会在没有这些权限的情况下运行。我如何给(当前运行)应用程序的权限,并获得键盘钩工作?我需要重新启动应用程式吗?

My problem is that, even after Enabling Access via the checkbox, the app continues to run without those privileges. How do I give the (currently running) app the privileges and get the keyboard hook working? Do I need to restart the app?

推荐答案

查看您张贴的连结,

I asked the Accessibility engineer again, and apparently you have to
re-exec or re-launch the now-trusted application for the new state to
take effect.

我会向用户提供一个通知或消息,应用程序必须重新启动才能启用辅助权限,然后重新启动它。

I would present the user with a notification or message that the application has to restart to enable assistive privileges, then restart it.

这篇关于如何提供我的应用程序“辅助访问权限”一次“辅助设备的启用访问”已检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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