LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-12-2019, 05:06 PM   #1
arcctgx
Member
 
Registered: Mar 2006
Location: EU
Distribution: Slackware, Gentoo
Posts: 48

Rep: Reputation: 23
Inconsitent Caps Lock behavior in virtual console with UTF-8


Some time ago I switched my system from the default ISO 8859-2 encoding for Polish locale to UTF-8 (according to https://docs.slackware.com/slackware:localization). While everything is working correctly, there is one unexpected side effect.

In the virtual console (outside XServer), the Caps Lock key is now acting inconsistently. When Caps Lock is pressed and I'm entering Polish special characters, they are not written in upper case (with the exception of ''). I can enter the upper case special Polish characters using Shift, but not using Caps Lock.

Slackware provides 5 qwerty keyboard maps for Polish language, I tried all of them but that didn't change anything.

Web search for similar issues proved unsuccessful, I was only able to find some old bug reports for Firefox that described similar behavior in that browser. Unfortunately it's not relavant to my case.

Of course it's not a big deal and it doesn't affect me much, but I'm really curious what could be the reason for this behavior. Does anyone have any idea?
 
Old 09-13-2019, 05:40 AM   #2
Labinnah
Member
 
Registered: May 2014
Location: Łdź, Poland
Distribution: Slackware-current
Posts: 158

Rep: Reputation: 93
I've never see such issue. I've attach xev output from properly working system - maybe it helps you to track down problem.
Code:
KeyPress event, serial 37, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18527462, (71,98), root:(71,170),
    state 0x10, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18529606, (71,98), root:(71,170),
    state 0x90, keycode 32 (keysym 0xf3, oacute), same_screen YES,
    XLookupString gives 2 bytes: (c3 b3) ""
    XmbLookupString gives 2 bytes: (c3 b3) ""
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18529774, (71,98), root:(71,170),
    state 0x90, keycode 32 (keysym 0xf3, oacute), same_screen YES,
    XLookupString gives 2 bytes: (c3 b3) ""
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18534358, (71,98), root:(71,170),
    state 0x90, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18539839, (71,98), root:(71,170),
    state 0x10, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18540886, (71,98), root:(71,170),
    state 0x90, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18541670, (71,98), root:(71,170),
    state 0x91, keycode 32 (keysym 0xd3, Oacute), same_screen YES,
    XLookupString gives 2 bytes: (c3 93) ""
    XmbLookupString gives 2 bytes: (c3 93) ""
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18541822, (71,98), root:(71,170),
    state 0x91, keycode 32 (keysym 0xd3, Oacute), same_screen YES,
    XLookupString gives 2 bytes: (c3 93) ""
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18543158, (71,98), root:(71,170),
    state 0x91, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18543671, (71,98), root:(71,170),
    state 0x90, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18546134, (71,98), root:(71,170),
    state 0x10, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18546230, (71,98), root:(71,170),
    state 0x12, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18547726, (71,98), root:(71,170),
    state 0x12, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18548518, (71,98), root:(71,170),
    state 0x92, keycode 32 (keysym 0xd3, Oacute), same_screen YES,
    XLookupString gives 2 bytes: (c3 93) ""
    XmbLookupString gives 2 bytes: (c3 93) ""
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18548654, (71,98), root:(71,170),
    state 0x92, keycode 32 (keysym 0xd3, Oacute), same_screen YES,
    XLookupString gives 2 bytes: (c3 93) ""
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18550182, (71,98), root:(71,170),
    state 0x92, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18550662, (71,98), root:(71,170),
    state 0x93, keycode 32 (keysym 0xf3, oacute), same_screen YES,
    XLookupString gives 2 bytes: (c3 b3) ""
    XmbLookupString gives 2 bytes: (c3 b3) ""
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18550814, (71,98), root:(71,170),
    state 0x93, keycode 32 (keysym 0xf3, oacute), same_screen YES,
    XLookupString gives 2 bytes: (c3 b3) ""
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18551606, (71,98), root:(71,170),
    state 0x93, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7600001,
    root 0xc8, subw 0x0, time 18551670, (71,98), root:(71,170),
    state 0x92, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
 
Old 09-13-2019, 06:01 AM   #3
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,179
Blog Entries: 18

Rep: Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895
In the console keymap, keysyms that are affected by capslock are tagged with a '+' sign prefix. It's likely that your special keys haven't be configured that way in the keymap you are using.

man 5 keymaps for details.
 
Old 09-13-2019, 09:32 AM   #4
arcctgx
Member
 
Registered: Mar 2006
Location: EU
Distribution: Slackware, Gentoo
Posts: 48

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by Labinnah View Post
I've never see such issue. I've attach xev output from properly working system - maybe it helps you to track down problem.
Thanks, but I only have the problem in the virtual console (outside X Window System). So I can't use xev to debug my problem.

Quote:
Originally Posted by GazL View Post
In the console keymap, keysyms that are affected by capslock are tagged with a '+' sign prefix. It's likely that your special keys haven't be configured that way in the keymap you are using.
man 5 keymap says: "Each keysym may be prefixed by a '+' (plus sign), in wich case this keysym is treated as a "letter" and therefore affected by the "CapsLock" the same way as by "Shift" (to be correct, the CapsLock inverts the Shift state). The ASCII letters ('a'-'z' and 'A'-'Z') are made CapsLock'able by default." And it looks like my keyboard map defines it that way:
Code:
$ zgrep -C1 + /usr/share/kbd/keymaps/i386/qwerty/pl2.map.gz
# From: Rafal Maszkowski <rzm@dain.oso.chalmers.se>
# Date: Mon, 7 Feb 1994 12:00:39 +0100 (MET)
#
# Polish "programmers' keyboard" + paragraph sign AltGr-4, v. 0.92
# Rafal Maszkowski <rzm@oso.chalmers.se>, <rzm@mat.uni.torun.pl>, 94.02.16
--
keycode  18 = e               
	AltGr		keycode  18 = +eogonek
	AltGr		Shift keycode  18 = +Eogonek
keycode  19 = r               
--
keycode  24 = o               
	AltGr		keycode  24 = +oacute
	AltGr		Shift keycode  24 = +Oacute
keycode  25 = p               
--
keycode  30 = a               
	AltGr		keycode  30 = +aogonek
	AltGr		Shift keycode  30 = +Aogonek
keycode  31 = s               
	AltGr		keycode  31 = +sacute
	AltGr		Shift keycode  31 = +Sacute
keycode  32 = d               
--
keycode  38 = l               
	AltGr		keycode  38 = +lstroke
	AltGr		Shift keycode  38 = +Lstroke
keycode  39 = semicolon        colon           
--
keycode  44 = z               
	AltGr		keycode  44 = +zabovedot
	AltGr		Shift keycode  44 = +Zabovedot
keycode  45 = x               
	AltGr		keycode  45 = +zacute
	AltGr		Shift keycode  45 = +Zacute
keycode  46 = c               
	AltGr		keycode  46 = +cacute
	AltGr		Shift keycode  46 = +Cacute
keycode  47 = v               
--
keycode  49 = n               
	AltGr		keycode  49 = +nacute
	AltGr		Shift keycode  49 = +Nacute
keycode  50 = m
Interesting thing is that the definition of "O acute" (which for some reason is the only caps-lockable letter) is similar to the others.

I also found a mention of patching the kernel: http://www.tldp.org/HOWTO/Unicode-HOWTO-2.html#ss2.1: "If your keyboard or, more precisely, your normal keymap has non-ASCII letter keys (like the German Umlaute) which you would like to be CapsLockable, you need to apply the kernel patch linux-2.2.9-keyboard.diff or linux-2.3.12-keyboard.diff". The links to the patches are dead, of course, and judging from the versions this is outdated anyway...

At this point I'm starting to think I'm just wasting time trying to get to the bottom of this. But this is so frustrating. Unicode and UTF-8 have been around for a long time now, but such a basic thing is not working right in 2019...
 
Old 09-13-2019, 09:41 AM   #5
Labinnah
Member
 
Registered: May 2014
Location: Łdź, Poland
Distribution: Slackware-current
Posts: 158

Rep: Reputation: 93
In place you run "loadkeys" add "-u" parameter:

Code:
loadkeys -u pl
I put it in /etc/rc.d/rc.font
 
Old 09-13-2019, 10:08 AM   #6
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,179
Blog Entries: 18

Rep: Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895
I just did a test remapping the 'q' key. I thought I'd rule out any impact alt-gr was having. Answer: it wasn't.


keycode 16 = +sacute +Sacute
doesn't work as described in the man page.
keycode 16 = +oacute +Oacute works as described.

I have no idea why.

p.s. I tried -u here. No difference. but then my keyboard was already in utf8 mode.

Last edited by GazL; 09-13-2019 at 10:09 AM.
 
Old 09-13-2019, 10:38 AM   #7
arcctgx
Member
 
Registered: Mar 2006
Location: EU
Distribution: Slackware, Gentoo
Posts: 48

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by Labinnah View Post
In place you run "loadkeys" add "-u" parameter:
Code:
loadkeys -u pl
I put it in /etc/rc.d/rc.font
This is the way I'm currently calling setfont and loadkeys:
Code:
$ cat /etc/rc.d/rc.font 
#!/bin/sh
#
# This selects your default screen font from among the ones in
# /usr/share/kbd/consolefonts.
#
setfont -v lat2-16.psfu.gz

$ cat /etc/rc.d/rc.keymap 
#!/bin/sh
# Load the keyboard map.  More maps are in /usr/share/kbd/keymaps.
if [ -x /usr/bin/loadkeys ]; then
 /usr/bin/loadkeys pl2.map
fi
I tried adding -u option to loadkeys as you suggested, and also tried adding "-m 8859-2" to setfont. No luck.

And by the way, I just checked and I have exactly the same problem in Gentoo on another machine. So this is not Slackware specific. Either I messed up the configuration in an not-so-obvious way on both my machines, or there's something wrong. Somewhere.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
all software installs hang scroll lock and caps lock lights flash jcorrnt Linux - Hardware 6 02-07-2009 12:44 PM
Caps Lock & Scroll Lock Flashing thedug Linux - General 6 06-07-2008 09:43 PM
Caps Lock and Num Lock leds dont work! npc Linux - Hardware 2 11-08-2005 10:40 AM
Num, Scroll, Caps/Lock all Lock up Slackware Zamochit Linux - Newbie 0 10-18-2004 07:47 PM
RedHat 9.0 freezes with blinking Caps lock and Scroll lock queen-bee Linux - Software 0 07-30-2004 10:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration