Open SebastianAigner opened 3 years ago
Overall, look sensible that API like that may be helpful. But it probably requires some native code (in Skiko?).
Intuitively, it seems like this is orthogonal to Compose? Feels like JHotKeys (or a KotlinNative variant thereof) might be the right project for something like this? Anyone interested in that feature should contribute to JHotKeys to make it less meager or start their own KotlinNative-based competitor?
Is there a reason this needs to be Compose specific? Based on the description, if the window doesn't have focus, then it doesn't seem like it would need to tie into the Compose focus manager or anything like that?
I suppose the argument that it is similar to tray integration is the most compelling one, although I wonder if maybe tray integration should also be spun off into its own separate library/dependency. The thing about tray integration is that you probably want the tray to have a menu and that menu would presumably be rendered with Compose, so the relationship/dependencies are a bit more entangled there.
Probably documenting how to use JHotKeys (or whatever solution) in a tutorial might be a good idea though, especially to parallel the electron documentation there.
A bit of off-topic, I did asked it in the slack as well, I didn't got any option available at that time so started a small project on my own. I'd love if it can be integrated with the compose itself, the base native code for linux & windows can be found here if anybody want to look at it as a reference :-)
Is there anything new to this?
Any updates on this?
Any updates on this?
No updates for now
@SebastianAigner so at the end did you find a solution to global hotkey with compose desktop?
I'm using jkeymaster
, it's worked for my case.
here is the Github repo: https://github.com/tulskiy/jkeymaster
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
(This might be out of scope for CFD, so feel free to ignore).
Electron has the possibility of detecting Global Shortcuts:
It would be nice to have the same functionality available for compose for desktop applications – similar to tray integration, global shortcuts make helper tools easier to reach and use. However, it seems usage of system-wide hotkeys is nontrivial on the JVM, and library support (like JHotKeys) is meager.