Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One sticking point for people might be the way push-to-talk works for the in-browser version; the shortcut to trigger it will only work when you have the browser window focused (I think due to limitations in how browsers can capture inputs when not focused, which is a pretty reasonable policy in general). Not only does this mean you'd need to alt-tab over whenever you want to push to talk (which isn't super easy for a lot of potential use cases, like gaming), but if I remember correctly from trying this out once, you can have even more jarring bugs like "alt-tab over to the browser to hit push-to-talk shortcut, hit the shortcut, alt-tab back before releasing so you can keep talking, and then having the push to talk never deactivate because the browser didn't detect the key-up event due to a different window having focus when it happened".


On Linux, I just tested that if you have a Mozilla Firefox window running on X (I tested on XWayland but it should work just as well on X11) with the Discord tab in view, you can use your desktop's/compositor global keyboard shortcut functionality to call xdotool to send a keyup/keydown event without focusing the window, like this:

    xdotool search --name 'Discord.*— Mozilla Firefox' keydown F9
    xdotool search --name 'Discord.*— Mozilla Firefox' keyup F9
I configured web Discord to use F9 as the push to talk button since it seemingly doesn't conflict with anything in Firefox, but you can then bind it to any key or mouse button on your global keyboard shortcut settings.

According to some people on StackExchange (I didn't test myself) this doesn't work if you're using Discord on Chromium-based browsers, which seem to reject xdotool events unless the window is focused (which xdotool can do for you, but doesn't work for the PTT usecase). Of course, this doesn't work on Firefox when running native Wayland windows because xdotool is X-only, and ydotool doesn't work either because it emulates a virtual device which would mean you still need to focus the window.


> this doesn't work if you're using Discord on Chromium-based browsers […] this doesn't work on Firefox when running native Wayland windows

It seems like a WebExtension using dispatchEvent could solve both these issues.


> Link?

https://unix.stackexchange.com/a/87839

> It seems like a WebExtension using dispatchEvent could solve both these issues.

Great idea! Couldn't find anything any pre-existing project like that from a quick web search and tbh I have enough side projects as it is, but that would indeed solve the issue for both.


In case you (or anyone else) is a windows user with the same issue, I ended up rolling my own solution for it: https://github.com/9001/uptt


Oh wow, that's super interesting! In retrospect it's super clear that muting and unmuting the microphone system-wide will pretty much always work, since it's incredibly unlikely someone would need to have input on between push-to-talk activations, but for whatever reason, it never occurred to me. I use a cheap USB foot pedal to avoid needing to manage holding down the button while trying to do stuff in-game, and I'm realizing now how obvious it is that making it just toggle mute/unmute on each press rather than needing to hold down my foot would be _way_ more convenient!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: