noblereign / GX-Mods-Extension

A WebExtension for Firefox. Add ambient music, typing sounds, and more to your browsing experience.
MIT License
22 stars 1 forks source link

Keyboard sound plays with no keystroke input #22

Closed MaisieOfMystery closed 1 month ago

MaisieOfMystery commented 1 month ago

Seemingly at random, Firefox will play a keyboard click noise despite no input from my keyboard. I figured it must have to be something with the keyboard itself, but the same issue persists even with a different keyboard. It even plays randomly when Firefox is minimized and I'm doing something in Discord/Spotify/etc.

It's not too common, and turning off the keyboard sounds at all fixes it, but just turning it off isn't exactly ideal. I've restarted my computer and uninstalled/reinstalled the extension, but the issue persists.

noblereign commented 1 month ago

do you have the "detect in address bar" option enabled? if so, it may be related to that, as it can cause false positives due to the admittedly scuffed methods required to make it work.

if you do have it on, then Firefox must be sending some requests that I haven't observed on my install, and I'll need to see if I can find them on a fresh install

if you don't have it on, then something must be triggering the javascript key press event somehow... 🤔🤔

MaisieOfMystery commented 1 month ago

Yeah, I have "detect in address bar" turned off. This started happening after the update that implemented it, though, if that helps narrow it down.

noblereign commented 1 month ago

i have a feeling it might be this piece of code right here since it's the only time a keyboard sound would play outside of either actual keyboard presses or the address bar detection image maybe (cachedSettings.sfxKeyboard && cachedSettings.sfxAddressBar) is returning true when it shouldn't be i'll try changing the code and then releasing it in the next update, might take a bit though since i'm currently eating dinner

MaisieOfMystery commented 1 month ago

Nice! I will patiently await the update <3

noblereign commented 1 month ago

i just released 6.3.0 and i did try changing up the code a little, however i'm not sure if it fixes the issue. can you update and give it a try?

MaisieOfMystery commented 1 month ago

I've been using it all day and haven't encountered it once! That update seemed to do the trick, thank you so much ^^

MaisieOfMystery commented 1 month ago

Ack, false alarm. It's been happening again.

noblereign commented 1 month ago

mmm, i have no clue what it could be... i think i might try creating a new version with a debug option to log when the keyboard sounds are played so we can figure out what's causing it, cause since you don't have the address bar option on i don't really know what could be causing false positives

MaisieOfMystery commented 1 month ago

It's ultimately super minor so not a big deal, but I will keep my eyes peeled if it's ever implemented <3 Thank you again either way, I super appreciate all this.

noblereign commented 1 month ago

i uploaded the version with the logging feature, version 6.3.1 you can access the debug options by clicking on the version number at the bottom:

image image

whenever you feel like it, just toggle on the switch and do whatever until you notice it happen once you notice it you should go back to the mod manager and export the log, it might be able to tell us more about why the sound is playing

MaisieOfMystery commented 1 month ago

Alright, I think I figured it out: all the keystrokes are coming from youtube tabs. Having fiddled with my youtube addons, it seems like it's conflicting with the "YouTube Redux" addon. No clue why it's doing that, but disabling that addon fixed the problem lol ^^

noblereign commented 1 month ago

looking at the code for youtube redux, it seems like it might be related to this: image image there should be a setting called "Auto-confirm 'video paused' popup", and the way that it seems to work is by faking a keyboard down event, causing GXM to pick it up and play a keyboard sound. if you turn that off you should be able to keep using Youtube Redux without having to deal with the random sound

MaisieOfMystery commented 1 month ago

Perfect! Thank you so much!! You're an angel ^^