-
-
Notifications
You must be signed in to change notification settings - Fork 232
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 |
02803f0
to
8d3196c
Compare
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 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 |
convert id to number enable desktop only shortcut actions
Co-Authored-By: exhq <[email protected]>
TEMPORARY: show keybind ID in the keybind page
update venbind
Hello! I know this is a draft PR, and it's still a work in progress, but I tried this on Windows by setting a keybind in the settings and doing: .\Vesktop.exe -- --keybind 2 I also tried doing: .\Vesktop.exe --keybind 2 And nothing happened when I tried to press the assigned keybind. Also, for whatever reason, trying to set a bind from your mouse in the settings doesn't appear to register. |
is your keybind push to talk? i've just recently found out that requires some extra context in the code that i haven't yet found a way to provide.
that's a limitation of electron/web in general. discord works around that by doing their keybind recording through their native module. |
Github merge ui is 💀
I tried it with the latest commit again.
It's the "Toggle Mute" action. When I run: .\Vesktop.exe -- --keybind 2 It toggles the mute on and off in Discord. However, when I try to use the assigned keybinding I set in the settings, trying to run that command again doesn't do anything. |
turns out an update caused issues with registering new keybinds. can you try the latest commit? |
Is it possible to do something similar on Linux? |
Ah, I noticed. |
you love half line fixes
With this latest commit i'd say most basic functionalities are ready for use. i'd appreciate if yall did some testing of this fork in case any bugs pop up |
working beautifully here on KDE (wayland) |
It works with the latest commit. The only thing I'd want on my wish list is a way to have mouse bindings, even if I have to do it manually since Discord's in-client keybinding manager doesn't pick it up because of Electron. |
can you not manually bind your mouse through the cli with the latest commit? |
Hello, is glibc 2.39 the minimum required for venbind? I'm running Pop! OS 22.04 with a glib version of 2.35 (which, as far as I know, is the latest supported version for the distro), and when I try to run the branch, it explains that venbind needs glibc 2.39 to run (full error below). I also tried building venbind myself, and the error persisted. Full Error
If this can't be changed, then it's completely okay (it's kinda my fault for using a 3-year-old distro too), but I just wanted to let you know in case this is an issue. |
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