Bug 1332648

Summary: Loadkeys is dysfunctional
Product: [Fedora] Fedora Reporter: dertobi
Component: kbdAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 24CC: vcrhonek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-09 12:14:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dertobi 2016-05-03 16:11:44 UTC
Description of problem:
Loadkeys doesn't work.

Version-Release number of selected component (if applicable):
rpm -qi kbd
Name        : kbd
Version     : 2.0.3
Release     : 3.fc24
Architecture: x86_64

How reproducible:
No matter which keyboad layout I try to load with loadkeys
it always prints errors.

If I do `loadkeys en` it prints:
"cannot open file en"
(This is a command that usually works across all distros
in my experience)

On `loadkeys de` it prints:
unknown keysym 'trademark'

unknown keysym 'trademark'

unknown keysym 'trademark'

unknown keysym 'trademark'

unknown keysym 'trademark'

unknown keysym 'trademark'

unknown keysym 'trademark'

unknown keysym 'trademark'

lk_add_key called with bad keycode -1


Additional info:

I tried this within a plasma 5.6 session in a konsole terminal.
The problem isn't that I can't set my keyboard layout, (I can
do that from KDE settings/Gnome settings etc.), but that
I can't switch between layouts for testing purposes etc. in
a single console window.

I also tested it in a fluxbox session with xterm (in a freshly
installed VM), same results.

Kind regards

Comment 1 Vitezslav Crhonek 2016-05-09 12:14:14 UTC
(In reply to dertobi from comment #0)

> 
> I tried this within a plasma 5.6 session in a konsole terminal.
> The problem isn't that I can't set my keyboard layout, (I can
> do that from KDE settings/Gnome settings etc.), but that
> I can't switch between layouts for testing purposes etc. in
> a single console window.
> 
> I also tested it in a fluxbox session with xterm (in a freshly
> installed VM), same results.
> 

loadkeys is not the right tool for changing keyboard layout in graphics mode (X server). It works and should work only in text console (ctrl+alt+FX). The errors you get are expected.

You probably want to use setxkbmap?

Comment 2 dertobi 2016-05-09 12:23:51 UTC
I suspected that.

I think this isn't exactly user friendly.

Wouldn't it make sense to ship a small wrapper for loadkeys
that detects it is running in an X session and just calls setxkbmap?

Kind regards