News for hackers. Stuff that matters.
Re:“Google Drive” would like to receive keystrokes from any ... by dortmunder13 on Sunday February 02, 2020 @12:36PM (#22218093)
Lastpass says: "The app needs this permission to provide a global, system-wide shortcut to bring up the search field, so that users can quickly locate a vault entry and copy passwords or launch sites. You can deny this permission request, as the Mac application will continue to work. It will just disable this function from working."

I bet it's similar here, they want a system-wide shortcut to get to google drive. Seems like an oddly named permission.

Re:“Google Drive” would like to receive keystrokes from any ... by mirthflat83 on Sunday February 02, 2020 @01:09PM (#22218306)
I like how they named it. If you can get permission for systemwide keystrokes it is also obviously able to see what you’re typing in other apps. More straightforward for those who are not tech oriented.
Re:“Google Drive” would like to receive keystrokes from any ... by soulofmischief on Sunday February 02, 2020 @01:14PM (#22218334)
Sounds like a bad API. There should be a way to register shortcuts and macros without giving keystroke information to the app.
Re:“Google Drive” would like to receive keystrokes from any ... by tryptophan on Sunday February 02, 2020 @02:28PM (#22218809)
Doesn't linux work like this? Where certain input starts at the top (kernel), and then goes to the first program that "listens" for a certain key/combo?

So you could have a program only listen/capture certain keys?

Re:“Google Drive” would like to receive keystrokes from any ... by jankotek on Sunday February 02, 2020 @02:38PM (#22218876)
XWin app can listen to all keystrokes in system. This was fixed in Wayland.
Re:“Google Drive” would like to receive keystrokes from any ... by adrianmonk on Sunday February 02, 2020 @05:11PM (#22219804)
Two different questions. You're talking about whether the app must get the user's approval. The question here (in this part of the thread) is whether the app must subscribe to all events and filter them itself or if it can instead subscribe to a filtered version of events.
Re:“Google Drive” would like to receive keystrokes from any ... by tryptophan on Sunday February 02, 2020 @03:18PM (#22219159)
I know that an Xapp can listen to everything, but I was thinking that it can listen to only some keys/combos.
Re:“Google Drive” would like to receive keystrokes from any ... by capableweb on Sunday February 02, 2020 @03:01PM (#22219051)
How would you write an application that uses global shortcuts in Wayland?
Re:“Google Drive” would like to receive keystrokes from any ... by ubercow13 on Sunday February 02, 2020 @03:11PM (#22219113)
Probably through a series of incompatible and as-yet-unimplemented APIs for each desktop environment and window manager you want to support.
Re:“Google Drive” would like to receive keystrokes from any ... by krageon on Monday February 03, 2020 @08:36AM (#22223991)
You wouldn't, because Wayland is not ready for consumption by people that use their computer with expectations of full functionality. The obvious things for most people (shortcuts being one of them) do not yet work in it.
Re:“Google Drive” would like to receive keystrokes from any ... by sam_lowry_ on Sunday February 02, 2020 @02:42PM (#22218915)
"fixed".
Re:“Google Drive” would like to receive keystrokes from any ... by lexicality on Sunday February 02, 2020 @01:19PM (#22218381)
Especially given Apple apps seem to be able to register keyboard shortcuts in the system preferences and let you change them...
Re:“Google Drive” would like to receive keystrokes from any ... by kitsunesoba on Sunday February 02, 2020 @04:29PM (#22219569)
That works through the menu system, so any app that uses the standard menubar can have shortcuts reassigned. It works well, but it comes with the downside that the shortcuts are not global.
Re:“Google Drive” would like to receive keystrokes from any ... by xg15 on Sunday February 02, 2020 @07:01PM (#22220380)
If we're at API design, I'd like an even more abstract one: Let the app register intents with associated title, description, icon and suggestion for a keyboard shortcut and let the OS manage how the intent is invoked.
Re:“Google Drive” would like to receive keystrokes from any ... by gnachman on Sunday February 02, 2020 @03:51PM (#22219327)
Carbon hotkeys are how you register for a single keystroke. Event taps give you everything. This sounds more like the latter.
Re:“Google Drive” would like to receive keystrokes from any ... by sukilot on Sunday February 02, 2020 @01:12PM (#22218321)
Only because MacOS doesn't provide a more specific shortcut functionality. It should let an app register the specific keystrokes to get notified by, and doesn't need to notify which app was foreground when the shortcut was invoked.
Re:“Google Drive” would like to receive keystrokes from any ... by pdkl95 on Sunday February 02, 2020 @01:47PM (#22218553)
Since the proper API isn't available, the principle of least privilege suggests that abusing a high-privilege, easily abused feature in an unorthodox manner to work around that problem might be a bad idea. Maybe MacOS shouldn't have this "systemwide shortcut" feature until it provides the necessary functionality. Currently that feature appears to be incompatible with the platform's security model; don't undermine that model just to make a hotkey feature work.
Re:“Google Drive” would like to receive keystrokes from any ... by adrianmonk on Sunday February 02, 2020 @05:24PM (#22219884)
My guess is this API predates the introduction of these new security approvals. Some quick googling revealed that several developers are not even clear why their app causes the new macOS to ask the user for this approval.

I agree it's better not to have features that don't mesh with the security model, but when you're tightening down the security on an existing design, you may have to deal with awkward transitions. Even if they introduced a replacement API that fits with their security model better, a bunch of apps out there would have to be ported to use it, so they're going to need to maintain backward compatibility for a long while.

Re:“Google Drive” would like to receive keystrokes from any ... by ben509 on Sunday February 02, 2020 @01:41PM (#22218518)
It would also be helpful in letting users figure out conflicting shortcuts.
Re:“Google Drive” would like to receive keystrokes from any ... by jjeaff on Sunday February 02, 2020 @01:11PM (#22218315)
But why would that permission be needed at all for this use case? Is there not a simple "allow us to create a keyboard shortcut" permission?
Re:“Google Drive” would like to receive keystrokes from any ... by inetknght on Sunday February 02, 2020 @12:40PM (#22218120)
A system-wide shortcut to get to something which other applications aren't able to use is a Bad Thing.

For example: if you're in Notepad, how do you save your file to Google Drive?

Or for example: if you're in Notepad, why do you need your password?

Re:“Google Drive” would like to receive keystrokes from any ... by dan-robertson on Sunday February 02, 2020 @12:48PM (#22218174)
On the other hand it’s hard to predict all the ways a feature might be used so why restrict it’s flexibility to your own imagination.