Keyboard setting transient with YAST

Hi all. I finally bit the bullet and installed Leap. Using Yast I can change the keyboard to a UK keyboard and although the correct symbols initially result in testing it in yast, the new keyboard bindings change back to the US keyboard in under a minute. (Tried using the Konsole but same result of course). Once it even changed while I was typing into the test box. This old computer does have slightly strange USB hardware setup (USB device errors shown on installation but the installation program seems to get around that).
I would post some system files but not sure what would be useful. Any suggestions please?
:\

@Tweakey:

Did you, follow the instructions here? → <https://doc.opensuse.org/documentation/leap/startup/html/book-startup/cha-yast-hw.html#sec-yast-hw-keym>.
Alternatively, here? → <https://doc.opensuse.org/documentation/leap/startup/html/book-startup/cha-yast-lang.html#sec-yast-lang-primsec> → “Adapt Keyboard Layout to English (US)”.

With a CLI (terminal window), check the output of the following commands:


 > localectl
 > cat /etc/vconsole.conf

For the case of “localectl” there should be an entry similar to this (German keyboard case) –

       VC Keymap: de-latin1-nodeadkeys

Also from a CLI but, with the user “root”, you could also take a look at the output of –

 # journalctl --output=short-monotonic --no-hostname --boot | grep -i 'keybo'

Thanks for this; I had followed the first instruction on changing the keyboard and now I changed the language to UK English, but this only had the same effect of temporarily producing the right key-bindings (actually the command-line only returned cryptic numbers for the language change instruction but the graphic interface was fine). I did also log out and log in as the second user to aply the changes there, but the same result.

The commands you suggest seem to show that the UK keyboard is selected, which is interesting.
~> localectl
System Locale: LANG=en_GB.UTF-8
VC Keymap: uk
X11 Layout: gb
X11 Model: pc105
X11 Options: terminate:ctrl_alt_bksp

~> cat /etc/vconsole.conf
KEYMAP=uk
FONT=eurlatgr.psfu
FONT_MAP=
FONT_UNIMAP=

~> sudo journalctl --output=short-monotonic --no-hostname --boot | grep -i ‘keybo’

4.355581] kernel: hid-generic 0003:05D5:624C.0001: input,hidraw0: USB HID v1.11 Keyboard [KB USB KB] on usb-0000:00:1a.0-1/input0
4.419576] kernel: input: KB USB KB Keyboard as /devices/pci0000:00/0000:00:1a.0/usb2/2-1/2-1:1.1/0003:05D5:624C.0002/input/input4
4.419628] kernel: hid-generic 0003:05D5:624C.0002: input,hidraw1: USB HID v1.11 Keyboard [KB USB KB] on usb-0000:00:1a.0-1/input1

20.746222] systemd[1]: Starting Apply settings from /etc/sysconfig/keyboard…
21.275611] systemd[1]: Finished Apply settings from /etc/sysconfig/keyboard.
22.795932] systemd-logind[1110]: Watching system buttons on /dev/input/event3 (KB USB KB Keyboard)
90.509769] sddm-greeter[1681]: Hunspell dictionary is missing for “en_GB” . Search paths ("/usr/share/qt5/qtvirtualkeyboard/hunspell", “/usr/share/hunspell”, “/usr/share/myspell/dicts”)
495.496296] systemd[1]: Stopped Apply settings from /etc/sysconfig/keyboard.
495.496361] systemd[1]: Stopping Apply settings from /etc/sysconfig/keyboard…
495.496427] systemd-localed[8012]: Changing X11 keyboard layout to ‘us’ model ‘pc105+inet’ variant ‘’ options ‘terminate:ctrl_alt_bksp’
495.867865] systemd[1]: Starting Apply settings from /etc/sysconfig/keyboard…
495.959977] systemd[1]: Finished Apply settings from /etc/sysconfig/keyboard.
510.019096] systemd[1]: Stopped Apply settings from /etc/sysconfig/keyboard.
510.019161] systemd[1]: Stopping Apply settings from /etc/sysconfig/keyboard…
510.019639] systemd-localed[8012]: Changing X11 keyboard layout to ‘gb’ model ‘pc105’ variant ‘’ options ‘terminate:ctrl_alt_bksp’
510.062974] systemd[1]: Starting Apply settings from /etc/sysconfig/keyboard…
510.114926] systemd[1]: Finished Apply settings from /etc/sysconfig/keyboard.

Sorry for pasting what might be un-necessary but does this give any clues?

The correct keyboard is indeed installed… logging into a terminal after doing CTRL-ALT-F1 results in the correct characters for the keys as marked. for instance SHIFT-2 shows " but if I do that here I get @. The real problem is that I need the currency symbol for sterling (GBP). …
(BTW I was trying with only the keyboard plugged in to eliminate USB conflicts)

@Tweakey:

Given that, you have hardware which indicated some USB device errors at installation time, the following tools can be used for trouble shooting the keyboard behaviour –

  • During an X11 GUI session – KDE Plasma; GNOME; whatever – check the keyboard’s key behaviour with –
 > xev -event keyboard
  • From a Virtual Terminal (VT – tty1 … tty6 – … ) [no X11 GUI session] check the keyboard’s key behaviour with –
 > showkey

The USB behaviour can be checked with –


 # lsusb
 # lsusb --tree
 # lsusb --tree --verbose
 # lsusb --verbose -s ??:

Where “-s ??:” is the Bus Number of the (USB) Bus where the Keyboard is connected.

  • For example for this system –

 # lsusb
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 046a:0023 Cherry GmbH Keyboard
Bus 001 Device 003: ID 046d:c069 Logitech, Inc. M-U0007 [Corded Mouse M500]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 # 

For the Mainboard I’m using, the Keyboard and the Mouse are both connected to the same USB Bus Number – “Bus 001”

 # lsusb --verbose -s 001:

[HR][/HR]What else to try?

  • Take a look inside the USB Plug of the Keyboard and the USB Sockets of the (old hardware) System –
    *=2]If dirty or, even if seemingly clean, spray some “Contact Cleaner” into the space where the electrical contacts are located.

An aerosol can of “Contact Cleaner” is normally available from electronics component suppliers …

Hi
It looks to me as though the USB has actually been correctly installed (I have now given the plugs and sockets a blast of contact cleaner and plan to boot into my old OpenSuse 10.3 -problematic- to compare the results of the useful commands you suggested). But I have made a small step forward; if I run this in an X11 GUI session


> sudo xkbmap gb
[sudo] password for root: 
sudo: xkbmap: command not found
> sudo setxkbmap gb
Cannot open display "default display"
> sudo export DISPLAY=":0"

then the keyboard works with the UK settings! It doesn’t survive a reboot of course but if it proves consistent I can get on with other problems (installing my Nvidia GeForce 8500 GT the “hard way” as it doesn’t seem to be in the Nvidia repositories and replacing my scanner which is no longer supported).

It is interesting that you specify that I should run the xev command in an X11 GUI session, because when I try that I get the “If … not a typo … command-not-found …” even as root. It runs fine in a virtual terminal though.

Another “command-not-found” response from the Console comes when I try the export command as I pasted above; is this W.A.D. because its’ settings are constrained? Again it works fine in the virtual terminal.

Thanks for your help; any further thoughts would be greatly appreciated.
:slight_smile:

You need to install the “xev” package.

 # zypper install xev

The “setxkbmap” shouldn’t be run from the user “root” – unless of course, you’ve logged in to a GUI session as the user “root” …
Use the following command view the current X keyboard extension settings –

 > setxkbmap -print -verbose 10

Please inspect the contents of ‘/etc/X11/xorg.conf.d/00-keyboard.conf’ –

  • In particular the value of parameter “XkbLayout
    ”. - The value of the parameter “XkbVariant
    ” should also be checked.

To see the list of keymap layouts on your system, use –

 > localectl list-x11-keymap-layouts

The appropriate keymap layout code for the UK can be found by inspecting ‘/usr/share/X11/xkb/rules/base.lst’ –

  gb              English (UK)

[HR][/HR]Please note that “xkbmap” isn’t a current *NIX command – nowhere …

Hi
Thanks for all that info. I feel like I’m shining a light into dark corners.

Done that now (didn’t think of it as the command ran in a virtual terminal). So now it does run in Konsole in my x session and it shows the keybindings for a US keyboard instead of the gb keyboard that I have.

:open_mouth: Maybe I haven’t broken anything, but have I made scores of snapshots doing so? If so will they get deleted automatically or should I look into that?

There is a reference to a US keyboard here it seems…


setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us
options:    terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(evdev)+terminate(ctrl_alt_bksp)+terminate(ctrl_alt_bksp)
geometry:   pc(pc105)
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us+inet(evdev)+terminate(ctrl_alt_bksp)+terminate(ctrl_alt_bksp)"   };
        xkb_geometry  { include "pc(pc105)"     };
};

Here we are back to having a gb keyboard installed, but there is no entry for “XkbVariant”


> cat /etc/X11/xorg.conf.d/00-keyboard.conf | grep Xkb
        Option "XkbLayout" "gb"
        Option "XkbModel" "pc105"
        Option "XkbOptions" "terminate:ctrl_alt_bksp"

Thanks also for this info. I will follow the link to see if I can get a clue as to how this is happening.
:\

Use localectl:

**erlangen:~ #** localectl set-locale en_GB.UTF-8 
**erlangen:~ #** localectl set-keymap gb-intl  
**erlangen:~ #** localectl  
   System Locale: LANG=en_GB.UTF-8 
       VC Keymap: gb-intl 
      X11 Layout: gb 
       X11 Model: microsoftpro 
     X11 Variant: intl 
     X11 Options: terminate:ctrl_alt_bksp 
**erlangen:~ #**

OK I tried that but in an X session I still cannot get the UK keybindings. I can still get them in a virtual console, but some only appear as I move on to the next symbol.


/> localectl
System Locale: LANG=en_GB.UTF-8
VC Keymap: uk
X11 Layout: gb
X11 Model: pc105
X11 Options: terminate:ctrl_alt_bksp
/> localectl set-locale en_GB.UTF-8
/> localectl set-keymap gb-intl
/> localectl
System Locale: LANG=en_GB.UTF-8
VC Keymap: gb-intl
X11 Layout: gb
X11 Model: microsoftpro
X11 Variant: intl
X11 Options: terminate:ctrl_alt_bksp


I did have to put in the root password for the set-keymap gb-intl command

localectl changes system settings by modifying /etc/locale.conf and /etc/vconsole.conf. KDE stores user locale in ~/.config/plasma-localerc. Use ‘System Settings > Hardware > Input devices > Keyboard > Layouts > Add > gb, English (UK) > Apply’ to modify keyboard. Settings are stored:

karl@i3-4130:~> cat .config/kxkbrc  
$Version] 
update_info=kxkb_variants.upd:split-variants 

[Layout] 
DisplayNames=, 
**LayoutList=de,gb **
LayoutLoopCount=-1 
Model=pc105 
Options=terminate:ctrl_alt_bksp 
ResetOldOptions=true 
ShowFlag=false 
ShowLabel=true 
ShowLayoutIndicator=true 
ShowSingle=false 
SwitchMode=Global 
Use=true 
VariantList=nodeadkeys, 
karl@i3-4130:~> 

Switch keyboard in system tray of panel.

@Tweakey:

I’m beginning to wonder if – because I’m intermittently experiencing this on a somewhat older (bought around 2014) Laptop system – the following ArchWiki SDDM issue has reappeared – <https://wiki.archlinux.org/title/SDDM#SDDM_loads_only_US_keyboard_layout>.

Yes, I know, a shot in the dark but, I have it intermittently occurring on an older AMD Laptop but, not on this newer – built last year – AMD Desktop system …

Apologies karlmistelberger, I missed your suggestion. (This thread went on to a second page… doh! TBH I was getting a bit negative)
And it is SOLVED! I missed the hardware icon’s input devices option; doh DOH! (well in OpenSuse 10.3 I went from yast to Sax2 as that icon wasn’t there and I didn’t see it in the documentation… probably they thought it was obvious). The keyboard output exactly matches the key-presses now!

I changed the keyboard back to the 105 key international and removed the US keyboard while I was in the input devices>keyboard settings…


~> cat .config/kxkbrc
[Layout]
DisplayNames=
LayoutList=gb(extd)
LayoutLoopCount=-1
Model=pc105
ResetOldOptions=false
ShowFlag=false
ShowLabel=true
ShowLayoutIndicator=true
ShowSingle=false
SwitchMode=Global
Use=true
~>

~> localectl
   System Locale: LANG=en_GB.UTF-8
       VC Keymap: gb-intl
      X11 Layout: gb
       X11 Model: microsoftpro
     X11 Variant: intl
     X11 Options: terminate:ctrl_alt_bksp
~>

Now for the next tweak!:slight_smile:

Turns out it isn’t the keyboard that is at fault but the old Problem Between Chair and Keyboard! The info you gave me is very useful and I would like to set up the ability to use the Euro symbol using the info.
Thanks so much, I have learned a lot.

  • PEBKAC

Problem exists between Keyboard and Chair.

I’ve only ever written Software Change Requests – a request to change a perfectly implemented application in order that, it is changed to confirm with contractual requirements …

  • When, in the 1980’s, I spent some time in a customer call centre, we didn’t have to write detailed reports of the resolution of the customer’s issue – “PEBKAC” was invented later …

Great! I used HP-UX for years, but system administration never accomplished this. More on customization: How can I change what keys on my keyboard do? (How can I create custom keyboard commands/shortcuts?) - Ask Ubuntu

Thanks guys for all the help.:slight_smile: