-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add global shortcuts #326
base: main
Are you sure you want to change the base?
Conversation
Okay so electron's globalShortcuts api is not at all a good fit for this. the keyup/keydown events are rather crucial for discord's functionality. and also it "consumes" inputs (i have no idea what the correct term for this is. basically if you set anything as a keybind nothing else can use it, for example if you have the tab key as push to talk tab won't do anything everywhere else). |
yes. as mentioned in the issue you linked and as discussed on discord, using a native library would be better. however all the current options don't seem to support wayland at all, so we will most likely have to write our own module |
convert id to number enable desktop only shortcut actions
Co-Authored-By: exhq <infidelLOler@gmail.com>
TEMPORARY: show keybind ID in the keybind page
Could you do a quick write-up of how this works? E.g. is |
when you make a new keybind in discord asigns it an id. currently i have the id for each keybind written next to the keybind in the client. |
This comment was marked as spam.
This comment was marked as spam.
this doesn't seem to work on my setup on ubuntu with i3+x11, unless I still don't get how to use it. not sure if it's just not compatible with my setup or i'm just stupid, but if it doesn't work due to a window manager or display server problem it's something to look into. if i set a toggle mute keybind with an arbitrary key and it gets assigned an id of 3, running |
an update seems to have borked it |
@klhrt try this commit |
Whenever I run the keybind command, no response in-app and this error pops up. Not sure if the error is responsible/related though. I also don't know if it was happening in the earlier commit as I wasn't running vesktop from a terminal window. for reference this is the resulting printout from the terminal where i run the keybind command:
|
@klhrt ATM the command is |
and it works! thanks |
it would be nice if someone could test this commit on their system. the binary is technically built on nix and idk if that affects anything |
Can confirm X11 works! (Arch here) |
anyone know how hard it would be to get this to work on Hyprland? |
you'd have to implement xdg-desktop-portal's GlobalShortucts api for hyprland on their portal implementation (which they might have implemented already i'm not sure) |
Doesn't appear to be working on Hyprland or wayland in general. I can't even start the instance. Here's the full stack trace if that helps:
|
|
oh none of the wayland support stuff is pushed yet. currently venbind only supports linux x11 |
Over the weekend I started writing a C library (based on If anyone is willing to test it around, it'll be greatly appreciated. |
As an update for anyone with the PR watched: further work on Venbind has begun to support Windows and Wayland (through xdg-desktop-portal DBus), and is underway. |
An alternative to XDP if at all possible may need to be explored at some point for Venbind considering there is currently 3 different (2 confirmed) bugs blocking global shortcuts in KDE and Hyprland, which afaik are the only two actually usable global shortcuts XDP implementations hyprwm/xdg-desktop-portal-hyprland#310 |
Last time I worked with GlobalShortcuts on KDE it reused the previous session just fine (also tested right now). I honestly think the D-Bus portal is the way to go, mostly because will likely be the next standard for Wayland, but also because (from what I get) there is no intention here to use libevdev or similar input-permission related methods, even if it's just gonna be temporary. |
Yeah, the hyprland xdg PR got merged in 10 minutes apparently. However, the KDE bug was blocking testing of Venbind's XDG implementation by the Venbind maintainer - I couldn't test it on Hyprland because of that bug, but I'll give it a try with the latest commit of xdg-desktop-portal-hyprland. |
I think it's important to note that the Venbind maintainer hasn't had any Github activity over the past couple of months, so it might be necessary to make a hard fork of it if he doesn't reply soon. That decision is probably best left in the hands of @checkraisefold, as he is the one who is bringing back momentum into this PR. |
On that note, the maintainer is active in the Vencord Discord server #vesktop-development channel (where I have been very active in regards to looking at the Wayland/XDG issues, I pinged you in there). Shouldn't need to make a hard fork, I think they'll be able to merge the XDG pr soon once I test it on Hyprland. |
Basic Windows and Wayland (via xdg-desktop-portal) support have been merged into Venbind! 🥳 There won't be another tagged version of Venbind until it is at least somewhat usable (confirmed with maintainer) - key release events aren't implemented and there's issues with the existing implementation that need to be fixed. Once that's done, and Darwin support is done (shouldn't be too hard - libuiohook has it inbuilt) then Venbind should be pretty ready, and then everything's on the JavaScript side to implement. |
Changes for windows support
i'm using electron's globalShortcuts api here which doesn't have a way to detect tell the difference between keyup and keydown. this means the push to talk/mute/deafen/etc actions don't really work. we'd probably have to switch to something else at some pointcurrently implementing venbind to use instead of electron's api
resolves #18