geniiii / ripcord-audio-hook

Fixes Ripcord's voice chat functionality
MIT License
67 stars 4 forks source link

PTT/Keybind Modifier Key Fix #14

Open im-h opened 2 months ago

im-h commented 2 months ago

When a modifier key (Shift, Ctrl) is pressed, Push-to-Talk does not work (nor does muting or keybinds in general), could this be somehow changed?

geniiii commented 3 weeks ago

This is likely due to the Win32 hotkey API (see: RegisterHotKey). A workaround in theory would be to reregister the hotkey with all the modifiers set (and I'm not sure if that actually works), but a more proper alternative would be to use RawInput; cancel's reason for not already doing this is to not have Ripcord de facto act as a keylogger. If you're fine with that, I could probably add an option that replaces all the Ripcord hotkeys. It may however significantly raise AV detection rates as we would now not only be hijacking a DLL, but also constantly reading keyboard input...

im-h commented 3 weeks ago

This is likely due to the Win32 hotkey API (see: RegisterHotKey). A workaround in theory would be to reregister the hotkey with all the modifiers set (and I'm not sure if that actually works), but a more proper alternative would be to use RawInput; cancel's reason for not already doing this is to not have Ripcord de facto act as a keylogger. If you're fine with that, I could probably add an option that replaces all the Ripcord hotkeys. It may however significantly raise AV detection rates as we would now not only be hijacking a DLL, but also constantly reading keyboard input...

OBS has a similiar issue but i don't know if it's the same, which you can fix by adding the modifier keys, so i'd assume it'll work the same

image

geniiii commented 3 weeks ago

This is likely due to the Win32 hotkey API (see: RegisterHotKey). A workaround in theory would be to reregister the hotkey with all the modifiers set (and I'm not sure if that actually works), but a more proper alternative would be to use RawInput; cancel's reason for not already doing this is to not have Ripcord de facto act as a keylogger. If you're fine with that, I could probably add an option that replaces all the Ripcord hotkeys. It may however significantly raise AV detection rates as we would now not only be hijacking a DLL, but also constantly reading keyboard input...

OBS has a similiar issue but i don't know if it's the same, which you can fix by adding the modifier keys, so i'd assume it'll work the same

image

OBS uses GetAsyncKeyState to periodically poll for keyboard input, it doesn't actually use the Windows hotkey API. I'll see if registering multiple hotkeys with the same keycode but different modifiers works when I have time. Ripcord doesn't allow it for some reason, which makes me think it might have been deliberate.