You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On macOS, accessibility permissions are required before this library will function at all. See here. This is already documented in the README, but to make it easier on developers using this crate it would be nice if a message could be logged when the app doesn't have permissions. The API could also do this check and expose it as a function somewhere, so that consumers of the crate can write it to their own popup or messaging for their users.
Here's the example from the README, modified to show an example API:
let device_state:DeviceState = matchDeviceState::new(){Ok(device) => device,Err(DeviceError::InsufficientPermissions) => {message_box("Please enable Accessibility Permissions");return;},Err(e) => panic!("{}", e),};// The rest of the example is unchanged let mouse:MouseState = device_state.get_mouse();println!("Current Mouse Coordinates: {:?}", mouse.coords);let keys:Vec<Keycode> = device_state.get_keys();println!("Is A pressed? {}", keys.contains(Keycode::A));
I have no idea if Apple's APIs will allow this or not, so this is just spit balling to show usage. Once we know this can work, we can iterate on what a useful API would actually look like.
This commit in dteoh/SlowQuitApps added a popup dialog and is probably a good starting place to figure out how to include this kind of check.
The text was updated successfully, but these errors were encountered:
On macOS, accessibility permissions are required before this library will function at all. See here. This is already documented in the README, but to make it easier on developers using this crate it would be nice if a message could be logged when the app doesn't have permissions. The API could also do this check and expose it as a function somewhere, so that consumers of the crate can write it to their own popup or messaging for their users.
Here's the example from the README, modified to show an example API:
I have no idea if Apple's APIs will allow this or not, so this is just spit balling to show usage. Once we know this can work, we can iterate on what a useful API would actually look like.
This commit in dteoh/SlowQuitApps added a popup dialog and is probably a good starting place to figure out how to include this kind of check.
The text was updated successfully, but these errors were encountered: