Announcement

Collapse
No announcement yet.

How do I report irritating Swap Ctrl/Caps Lock bug?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I report irritating Swap Ctrl/Caps Lock bug?

    I need to report a bug and follow it. If you've followed my post about KVM switches (https://www.kubuntuforums.net/showth...599#post377599) you know what I'm talking about. I'm a Lost Star, that is, an ex WordStar user who got used to computers in the 80s that had the Ctrl key next to the A and the caps lock in the bottom row. Not a big problem. I've always found a way to accommodate myself via edits to the Windows registry in Windows and via settings in *buntu. In Kubuntu you can easily swap the Ctrl and Caps Lock key by doing this:

    Code:
    System Settings ==> Input Devices ==> Keyboard == > Advanced ==> Ctrl key position
    And then choosing:
    Code:
    Swap Ctrl and Caps Lock
    I've set up two PCs, a Lenovo desktop with Kubuntu 15.04 and an HP desktop with Windows 7. I just got an IOgear KVM switch in the mail today so that I can switch between the two. KVMing offers some advantages over running Windows under VirtualBox. However, when I jump from Kubuntu into Windows and back, suddenly the Ctrl and Caps Lock no longer are swapped. When I look into the settings, it shows them as still swapped. I have to uncheck "Swap Ctrl and Caps Lock" and re-check it to make it work right again.

    Obviously, I've encountered a bug. How do I report it to the Kubuntu team and how to I follow up on the progress of the bug fix? It would be great if they fixed this soon. It's a nuisance. If it's going to be a long time before it's fixed I might be better off reverting to 14.04 until the bug is fixed.
    Kubuntu 22.04 (desktop & laptop), Windows 7 &2K (via VirtualBox on desktop PC)
    ================================

    #2
    Annoying. Maybe not a Kubuntu bug per se - KVM switches aren't really common hardware. Likely the power state of the keyboard going on and off is causing the problem.

    Suggested solutions:

    1) Use Synergy instead of a KVM switch.
    2) Use Xmodmap instead of System Settings.

    Xmodmap: Create the file ~/.Xmodmap and put this in it;

    Code:
    keycode  37 = Caps_Lock NoSymbol Caps_Lock
    keycode  66 = Control_L NoSymbol Control_L
    That should swap your left Ctrl and Caps_lock keys...

    EDIT: I suppose if it worked in 14.04 and doesn't now, it's a bug of some sort. https://bugs.kde.org/

    Please Read Me

    Comment


      #3
      Originally posted by oshunluvr View Post
      Annoying. Maybe not a Kubuntu bug per se - KVM switches aren't really common hardware. Likely the power state of the keyboard going on and off is causing the problem.

      Suggested solutions:

      1) Use Synergy instead of a KVM switch.
      2) Use Xmodmap instead of System Settings.

      Xmodmap: Create the file ~/.Xmodmap and put this in it;

      Code:
      keycode  37 = Caps_Lock NoSymbol Caps_Lock
      keycode  66 = Control_L NoSymbol Control_L
      That should swap your left Ctrl and Caps_lock keys...

      EDIT: I suppose if it worked in 14.04 and doesn't now, it's a bug of some sort. https://bugs.kde.org/
      I don't know if it worked in 14.04. I wasn't KVMing with that version. 14.04 is on my laptop. I guess I could try KVMing with it and see if there are problems.
      Kubuntu 22.04 (desktop & laptop), Windows 7 &2K (via VirtualBox on desktop PC)
      ================================

      Comment


        #4
        An update: I've reported this as a bug. For now I'm just keeping the Keyboard Settings menu open while I work and then I un-check and re-check that box when I switch back into Kubuntu. I considered using Xmodmap, but the information I found when I googled it was discouraging. One person wrote:
        Ubuntu no longer uses xmodmap, but instead uses xkb (as far as I understand, this facilitates per-window keyboard layouts, among other things).

        The system-wide map files are in
        There was further conversation on how to use it anyway or to use xkb, but it all sounded problematic. Here's the page I read on it:
        http://askubuntu.com/questions/32527...n-ubuntu-13-04

        Seems like it might be simpler just to un-check and re-check that box every time I switch.
        Kubuntu 22.04 (desktop & laptop), Windows 7 &2K (via VirtualBox on desktop PC)
        ================================

        Comment


          #5
          Ubuntu might not support it but Kubuntu does - at least here on 15.04. If you have /etc/X11/Xsession.d/80kubuntu-xmodmap it will work. If not you can create it,

          Code:
          # Set custom keycodes#
          # This file is sourced by Xsession(5), not executed.
          # The "|| true" is to ensure that the Xsession script does not terminate on error
          
          
          USRMODMAP="$HOME/.Xmodmap"
          
          
          if [ -x /usr/bin/xmodmap ]; then
                  if [ -f "$USRMODMAP" ]; then
                          /usr/bin/xmodmap "$USRMODMAP" || true
                  fi
          fi
          and just because it's not "supported by Ubuntu" doesn't make it not exist as a possible work-around. Of course, you can just wait for someone to decide to fix the bug, if they decide it is a bug.

          I use xmodmap to reverse (which character results from "shift") the tilde/grave key and the slash/pipe key. As a console user, I use tilde and pipe way more than grave or slash.

          If you want to use xkb instead or xmodmap, the command is:

          setxkbmap -option ctrl:swapcaps

          This also sets it as a US keyboard, something xmodmap does not do. I suspect System Settings uses xkb thought, so this might not help.

          Please Read Me

          Comment


            #6
            Originally posted by oshunluvr View Post
            Ubuntu might not support it but Kubuntu does - at least here on 15.04. If you have /etc/X11/Xsession.d/80kubuntu-xmodmap it will work. If not you can create it,

            Code:
            # Set custom keycodes#
            # This file is sourced by Xsession(5), not executed.
            # The "|| true" is to ensure that the Xsession script does not terminate on error
            
            
            USRMODMAP="$HOME/.Xmodmap"
            
            
            if [ -x /usr/bin/xmodmap ]; then
                    if [ -f "$USRMODMAP" ]; then
                            /usr/bin/xmodmap "$USRMODMAP" || true
                    fi
            fi
            and just because it's not "supported by Ubuntu" doesn't make it not exist as a possible work-around. Of course, you can just wait for someone to decide to fix the bug, if they decide it is a bug.

            I use xmodmap to reverse (which character results from "shift") the tilde/grave key and the slash/pipe key. As a console user, I use tilde and pipe way more than grave or slash.

            If you want to use xkb instead or xmodmap, the command is:

            setxkbmap -option ctrl:swapcaps

            This also sets it as a US keyboard, something xmodmap does not do. I suspect System Settings uses xkb thought, so this might not help.
            Thanks for your help. I've tried your suggestion, but am still having problems. I may be doing it wrong. I found my 80kubuntu-xmodmap file and have tried it the following ways, none of which have worked:

            First Try:
            Code:
            # Set custom keycodes
            #
            # This file is sourced by Xsession(5), not executed.
            # The "|| true" is to ensure that the Xsession script does not terminate on error
            
            USRMODMAP="$HOME/.Xmodmap"
            
            if [ -x /usr/bin/xmodmap ]; then
                    if [ -f "$USRMODMAP" ]; then
                            /usr/bin/xmodmap "$USRMODMAP" || true
                            keycode  37 = Caps_Lock NoSymbol Caps_Lock
                            keycode  66 = Control_L NoSymbol Control_L
                    fi
            fi
            Second Try:
            Code:
            # Set custom keycodes
            #
            # This file is sourced by Xsession(5), not executed.
            # The "|| true" is to ensure that the Xsession script does not terminate on error
            
            USRMODMAP="$HOME/.Xmodmap"
            
            if [ -x /usr/bin/xmodmap ]; then
                    if [ -f "$USRMODMAP" ]; then
                            /usr/bin/xmodmap "$USRMODMAP" || true
                    fi
            fi
            
            keycode  37 = Caps_Lock NoSymbol Caps_Lock
            keycode  66 = Control_L NoSymbol Control_L
            Third Try:
            Code:
            # Set custom keycodes
            #
            # This file is sourced by Xsession(5), not executed.
            # The "|| true" is to ensure that the Xsession script does not terminate on error
            
            USRMODMAP="$HOME/.Xmodmap"
            
            keycode  37 = Caps_Lock NoSymbol Caps_Lock
            keycode  66 = Control_L NoSymbol Control_L
            
            if [ -x /usr/bin/xmodmap ]; then
                    if [ -f "$USRMODMAP" ]; then
                            /usr/bin/xmodmap "$USRMODMAP" || true
                    fi
            fi
            What am I missing?
            Kubuntu 22.04 (desktop & laptop), Windows 7 &2K (via VirtualBox on desktop PC)
            ================================

            Comment


              #7
              Originally posted by Tom_ZeCat View Post
              What am I missing?
              You're putting the keycode reassignments in the wrong file (Xsession which sources the file doesn't understand xmodmap rules directly).

              The purpoose of that file is to run /usr/bin/xmodmap using $HOME/.Xmodmap file as an argument. You need to put the keycode rules in that file ($HOME/.Xmodmap...like oshunluvr explained in a previous post)

              EDIT: Also, the xmodmap man page gives this example for switching caps/ctrl (not using keycodes...doesn't mean using keycodes won't work, though):
              One of the more irritating differences between keyboards is the location of the Control and CapsLock keys. A common use of xmodmap is to swap these
              two keys as follows:
              !
              ! Swap Caps_Lock and Control_L
              !
              remove Lock = Caps_Lock
              remove Control = Control_L
              keysym Control_L = Caps_Lock
              keysym Caps_Lock = Control_L
              add Lock = Caps_Lock
              add Control = Control_L


              This example can be run again to swap the keys back to their previous assignments.
              Last edited by kubicle; Aug 17, 2015, 01:08 AM.

              Comment


                #8
                Firstly, the system settings for "Configure keyboard options" are confusing and contradictory (in that some settings my contradict others) and which prevails seems to up to chance; writing a coherent and useful bug report would be a challenge. But you asked, it's bugs.kde.org. You'd be expected to search for and review similar bug reports.

                At the minute I use the system setting "Make Caps Lock an additional Ctrl", and as long as I don't tick any other "Caps Lock" options it works. In my .Xmodmap I have
                Code:
                clear Lock
                add Lock = Scroll_Lock
                to make the otherwise unused key into a caps lock on, for the rare times I want one, maybe once a month.
                Regards, John Little

                Comment


                  #9
                  Thanks for your help. I've saved your solutions into my CherryTree file, but am going to put this project on hold for now. The reason is the desktop's hard drive is about ready to fail. About every other time I boot up, a plain black screen comes up with the message that no OS is present. That's a classic sign of imminent hard drive failure, so I'll use my laptop (with 14.04) for now. I'm ordering a 1 TB Seagate SATA drive tonight and will pick up where I left off when it arrives. I've saved an Acronis ghost image of the desktop's drive onto an external hard drive, so I can just pick up where I left off when the drive gets here if I even decide to stay with 15.04. I tested the KVM jumps in 14.04 LTS and it does not have the bug. I'm also experiencing other frustrating bugs, especially my LibreOffice profile not working right. Only some of my macros run. So I might just revert back to 14.04 when the new drive gets here. I can always restore the ghost image at any time, run all the updates, and see if I like 15.04 better at that point. In any event, I have all my notes from this conversation saved in my Kubuntu CherryTree database. I keep notes on how to do everything I ever want to do so that I can always just look it up. Thanks to you guys, I know exactly what to do if I stick with 15.04 or if I return to it later.

                  While my new drive makes its journey to me, I have time to decide whether to stick with 15.04 or go back to 14.04.
                  Kubuntu 22.04 (desktop & laptop), Windows 7 &2K (via VirtualBox on desktop PC)
                  ================================

                  Comment

                  Working...
                  X