-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Global hotkeys are often essential for a speedrun timer. If you're running the timer in the same OS as the game you're speedrunning, you need to be able to split without the game window losing focus. As a developer familiar with the web philosophy, I can pretty confidently predict that global hotkeys will never be a web standard feature due to the security implications.
However, there are elaborate ways to accomplish global hotkey support, albeit very, very complicated. This isn't entirely in the domain of this project, but I thought I'd open a discussion thread here for anyone who is interested in both this project and this topic.
Inspired by some googling, here's one strategy that can get the job done:
- Install and run a native program in your OS that can respond to global hotkeys.
- Install a plugin/extension in your webbrowser that interacts with Splitty.
A chrome extension can be given permissions to make cross-origin requests, which means the extension can be listening to a server running on localhost. That server could be the native program mentioned above that is also listening for OS native global hotkeys. The sequence of events would then be this:
- User presses the global hotkey.
- Native app responds by sending a notification to the browser extension
- Browser extension tells Splitty to split.
- Splitty splits.
The relevance of this discussion in this project is that the Splitty team could provide official programs that fill each of those roles (probably as separate github repos). Splitty would, however, need an API for the chrome extension to use for step 3 above.