this post was submitted on 22 Jul 2024
10 points (100.0% liked)

LibreWolf

3133 readers
1 users here now

Welcome to the official community for LibreWolf.

LibreWolf is designed to increase protection against tracking and fingerprinting techniques, while also including a few security improvements. LibreWolf also aims to remove all the telemetry, data collection and annoyances, as well as disabling anti-freedom features like DRM. If you have any question please visit our FAQ first: https://librewolf.net/docs/faq/

To learn more or to download the browser visit the website: https://librewolf.net/

If you want to contribute head over to our Codeberg: https://codeberg.org/librewolf

founded 3 years ago
MODERATORS
 

I'm new here and am not sure if this is the right place to post a question about Librewolf. I found this area from the Librewolf site when trying to find a support forum of sorts. If this is not the place then I apologize and will know for in future.

I've found that my custom shortcuts on a website I built, no longer work as expected. For some reason, when I type "s" with the caps lock key on, it is treated as if I had typed "shift" + "s" to give the capital "S". This would normally be fine, but my site has shift + s treated as my "save" shortcut in Javascript, because ctrl + s triggers the browsers save page functionality. My custom shortcut works in traditional Firefox, but not Librewolf. Is there a reason that the caps-lock key converts the key events to as if we were holding down shift? Is there a way to disable this?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 3 months ago (2 children)

Ngl the first thing I do is to remap caps lock… I have it mapped to ESC.

Anyway, that actually is a cool idea/ bug.

Make caps lock useful ; remap another key to CL and see if the Bx is the same.. that would at least indicate that LW is seeing it as CL and not your custom function.

[–] [email protected] 4 points 3 months ago (1 children)

I dug into the code and tested again, and it appears that this bug/issue is actually around the event.shiftKey which registers as true in librewolf when the caps lock key is on, and shift is not pressed, and will register as false if the caps lock key is on, but shift is also on. Firefox on the other hand will register the event.shiftKey status as true/false simply based on whether the shift key is down or not, which is what I would generally sxpect from the browser.

In case it helps, the code in question is below:

if ((event.which == 83 || event.which == 115) && event.shiftKey) // shift-s
{
    // save the post.
}

This way, it checks for lower or uppercase S (83/115) and if the shift key is down. Thus the post will save with the shift+s key, no matter what state the caps lock key is in (in Firefox/chrome). However in librewolf, because the shift key is tied simply to capitalization (combos of shift and caps lock), if you just type a captial S, the save post functionality will trigger.

[–] [email protected] 1 points 3 months ago

Huh. Cool.

Not a dev; honestly I’d have thought the OS would have more control over that than LW.

TIL. Good luck 👍