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?

  • ProgramsterOP
    link
    fedilink
    English
    arrow-up
    4
    ·
    5 months ago

    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.

    • satanmat@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      5 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 👍