quicksilver / Quicksilver

Quicksilver Project Source
http://qsapp.com
Apache License 2.0
2.73k stars 285 forks source link

Request access to accessibility and input monitoring on 10.15+ #2703

Closed pjrobertson closed 2 years ago

pjrobertson commented 2 years ago

Fixes #2684

pjrobertson commented 2 years ago

@skurfer @n8henrie - I would appreciate one of you testing this code. I've written it blind, since I'm on 10.14 and can't run the 10.15 code.

Basically, it uses a new 10.15 call to check if QS has access to listen to events (needed for mouse triggers) and post events (to allow QS to 'paste' and imitate pressing keys). It would be worth checking a couple of scenarios:

  1. Standard scenario, just launch QS
  2. Scenario where you've gone into System Preferences > Security > Privacy and specifically denied QS access in the 'Accessibility' and 'Input Monitoring' panes (by unticking 'Quicksilver' in the list).

For scenario 2, QS should show an alert and then open up the System Preferences for you.

skurfer commented 2 years ago

It appears to work, but

  1. It shows 2 messages that look like they’re from the app and 1 that looks like it’s from the OS. I think maybe the alert should be moved outside the for loop.
  2. It adds QS to Input Monitoring (unchecked) automatically, but not to Accessibility.
  3. I don’t think I ever had Input Monitoring allowed before, but Paste and Type Text always worked. From some quick testing, it looks like Type Text, Paste, and Keyboard Triggers all fail if I only enable Input Monitoring. If I only enable Accessibility and disable Input Monitoring, they all work. So I think this check/alert only needs to work about Accessibility.
pjrobertson commented 2 years ago

Thanks for the debugging.

I think the original issue was filed RE mouse triggers. Can you confirm that mouse triggers work without enabling 'input monitoring'?

See: https://github.com/quicksilver/Quicksilver/issues/2545#issuecomment-1077700041

skurfer commented 2 years ago

I’m messing with Mouse Triggers, but I can’t get them to run at all. I see the glow on the edge of the screen, so it looks like QS is able to see the state of the mouse. (FWIW, unchecking “Input Monitoring” doesn’t appear to affect this.)

Need to do more debugging. I also see that the checkboxes next to the modifiers are missing somehow.

skurfer commented 2 years ago

Scratch that. The Mouse Trigger I was testing with had some conditions I had forgotten about. Once I figured that out, I can confirm that it works (even if QS isn’t listed under Input Monitoring).

pjrobertson commented 2 years ago

OK, so if you're able to use mouse triggers no problem, then I say there's no need for this, and no need to add an extra bit of code.

I'll mark #2684 as cannot reproduc