[REQUEST] Add global keybind/PTT support
Description
Currently the client thinks it's ran in a browser and doesn't allow the use of keybinds.
Use Case
I use keybinds on the daily for muting/unmuting myself while in-game and it's the sole thing that prevents my switch from discord.
Describe alternatives you've considered
Additional context
Are you talking about push to talk or Ctrl+Shift+M for toggling mute?
Are you talking about push to talk or Ctrl+Shift+M for toggling mute?
I'm talking about this:
Hello, I don't mean to necro-bump but since the issue is still open... the folks over at Vesktop got this working recently, see https://github.com/Vencord/Vesktop/pull/326. Maybe that can help with this?
Yes, it definitely will. This hasn't been implemented because something like Venbind didn't really exist before.
It seems keybinds aren't working outside of goofcord like being in Firefox or a video game, is this supposed to be normal behaviour?
What OS and CPU architecture are you on?
I'm having the same issue, I am on Arch Linux (KDE) and AMD Ryzen 9 5950X 16-Core Processor, x64. I need to have Goofcord selected in order for Push-to-Talk to work.
Edit: In the Shortcuts section in KDE settings I have the below setup:
Goofcord console returns:
VM23 node:events:518 GoofCord Keybind not found: Push To Talk
Q @ preload.mjs:1
K @ preload.mjs:1
(anonymous) @ preload.mjs:146
emit @ VM23 node:events:518
onMessage @ VM113 renderer_init:2
I am having the same issue with global keybindings. From the error I am seeing, I believe it may be a config error on my end but I am unable to figure out how to fix it:
venbind error: ashpd error: Portal request didn't succeed: Cancelled
P.S. should we move this into an issue instead of this PR?
OS: Gentoo CPU Arch: Ryzen 7 7700x x86_64
What OS and CPU architecture are you on?
Cachyos, kde plasma, Zen 4/Ryzen 7600, Flatpak goofcord
I'm using shift + fn2 for toggle muting and as you can see when i click outside of the app and try to do it, it wont do it but does it fine within goofcord, i made sure that it created a shortcut in kdes shortcut setting also, i also deleted goofcord fully just to see if it was a config issue and i dont think it is
https://github.com/user-attachments/assets/a2a1dd96-c87a-4709-bb6a-39a7a8d36dcb
@polluxau You need to add a shortcut in KDE's Shortcuts window for Toggle Mute. That shortcut is the one that should work outside GoofCord.
@polluxau You need to add a shortcut in KDE's Shortcuts window for Toggle Mute. That shortcut is the one that should work outside GoofCord.
oh i see, it works now thank you!
shouldn't it do that by default tho for the user as thats confusing in my opinion
shouldnt it do that by default tho for the user as thats confusing in my opinion
That is how it works on Windows and X11. On Wayland, apps can't grab global keys directly to prevent keylogging. For that GoofCord needs to use the GlobalShortcuts portal which allows apps to request shortcuts, which the desktop environment then manages and asks the user to approve.
I am having the same issue with global keybindings. From the error I am seeing, I believe it may be a config error on my end but I am unable to figure out how to fix it:
venbind error: ashpd error: Portal request didn't succeed: CancelledP.S. should we move this into an issue instead of this PR?OS: Gentoo CPU Arch: Ryzen 7 7700x x86_64
@nishiiko Your desktop environment probably doesn't support the GlobalShortcuts portal. If you are using a Wayland compositor, you can bind the desired keybinds to CLI triggers. Quote from 1.9.0 changelog:
If you are on Linux and your desktop environment does not support the GlobalShortcuts portal, you can manually bind your desired keybinds to CLI triggers:
goofcord --keybind-up="<keybind id>",goofcord --keybind-down="<keybind id>". You can get the id by opening DevTools (Ctrl+Shift+I), going to Console tab and modifying/adding a keybind. You should see an Array in the console which contains registered keybind ids. This process is temporary and will be improved in future versions.
shouldnt it do that by default tho for the user as thats confusing in my opinion
That is how it works on Windows and X11. On Wayland, apps can't grab global keys directly to prevent keylogging. For that GoofCord needs to use the GlobalShortcuts portal which allows apps to request shortcuts, which the desktop environment then manages and asks the user to approve.
i see, im pretty sure kde plasma is updating their ui for these shortcuts for user approval as it doesnt really do that right now and instead just spawns the shortcut setting page with no context so made it confusing, thanks for the help and context!
https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/368
If you are on Linux and your desktop environment does not support the GlobalShortcuts portal, you can manually bind your desired keybinds to CLI triggers: goofcord --keybind-up="
", goofcord --keybind-down=" " . You can get the id by opening DevTools (Ctrl+Shift+I), going to Console tab and modifying/adding a keybind. You should see an Array in the console which contains registered keybind ids. This process is temporary and will be improved in future versions.
I got it working with this instead, thanks
I have a question though, whats the difference between --keybind-down vs --keybind-up? The keybinds seem to only work with --keybind-up for me.
I got it working with this instead, thanks I have a question though, whats the difference between
--keybind-downvs--keybind-up? The keybinds seem to only work with--keybind-upfor me.
Most Discord keybinds are triggered when you release a keybind, not press it. --keybind-down is only needed for push to talk which activates on key down.
Is this is confusing and you don't use push to talk, GoofCord also accepts just --keybind= which acts as --keybind-up
I was able to get it to work by using a key combination (Alt+1) in Goofcord > Keybinds. Then on Global Shortcuts portal, Goofcord>Add the custom shortcut. I would get a "keybind not found" error any other method.
Also I noticed that Push-to-Talk does not seem to be working correctly, the mic does not stay on when holding the key down, it flashes for < 1s on the initial key push.