I have a new keyboard and have discovered that the scroll lock key does not work at all in Linux by default, at least not on TW/KDE. My keyboard needs this key to work in order to turn on and off the keyboard backlight. I found that by doing
Open with admin privilege the XKB configuration file located at /usr/share/X11/xkb/symbols/us
Modify it by adding modifier_map Mod3 { Scroll_Lock }; at the end of xkb_symbols “basic”
it allows the key to function, however this will get overridden at some stage.
So I’m looking for a better solution. Can anyone suggest how to do this perhaps using System Setting/Input Devices and adding something to the Keyboard Layouts tab?
Sadly Yast only allows the basic keyboard setup for layout, there are no more options in that Yast module. You can do more in System Settings Input Devices Keyboard but as yet I’ve not found any details of how to do it.
That Yast Sysconfig option does not work, after setting yes Scroll Lock does not work (and yes I removed my edit first).
I know there seems like I should be able to do it in System Settings Input Devices Keyboard but what exactly do I have to change as there is no obvious Scroll Lock option anywhere I can see.
The only thing whch works is editing that x11 file.
erlangen:~ # grep LOCK /etc/sysconfig/keyboard
KBD_NUMLOCK="bios"
KBD_SCRLOCK="yes"
KBD_CAPSLOCK="no"
# Disable CAPS LOCK and make it a normal Shift key?
KBD_DISABLE_CAPS_LOCK="yes"
erlangen:~ #
They all work in tty, but may be overridden in the GUI. xmodmap -e ‘add mod3 = Scroll_Lock’ works with KDE.
/usr/etc/X11/Xmodmap is owned by package xmodmap. Copy this file to ~/.Xmodmap, /etc/X11/xorg.conf.d/Xmodmap or /etc/X11/Xmodmap and modify it appropriately.
I’m trying to find the documentation which shows how to modify xmodmap to add Scroll Lock but all the info I’ve found so far does not mention Scroll Lock.
I am quite puzzled as to why this key does not work in Linux by default. Can anyone explain that please?
karl@erlangen:~> cat /usr/etc/X11/Xmodmap
!! ~/.Xmodmap
!!
**!! Use this as a template for $HOME/.Xmodmap **
!!
!! The leading `!' is the comment sign.
!!
!! Please note: the natural way to assign keys are their keycodes.
!! The only problem is, that keycodes do depend on the architecture,
!! therefore keysymbols are used herein. This has the disadvantage
!! that this file can only be called once with the program xmodmap.
!! To get keycodes of the keys use the program xev.
!! The system Xmodmap is /usr/X11R6/lib/X11/Xmodmap, have a look.
!! First example: Swap control key with caps lock key just like on
!! lk401 from DEC or type 4 from Sun Microsystems
!remove Lock = Caps_Lock
!remove Control = Control_L
!keysym Caps_Lock = Control_L
!keysym Control_L = Caps_Lock
!add Lock = Caps_Lock
!add Control = Control_L
!! Second example: Make left Alt key to left Meta key
!! Note that afterwards no key is assigned anymore to the symbol Alt_L.
!clear Mod1
!keysym Alt_L = Meta_L
!add Mod1 = Meta_L
!! Third example: Change right Control key to Compose key.
!! To do Compose Character, press this key and afterwards two
!! characters (e.g. `a' and `^' to get �).
!remove Control = Control_R
!keysym Control_R = Multi_key
!add Control = Control_R
!! Fourth example: Make Menu key on WIN95 keyboard doing Compose
!keysym Menu = Multi_key
!!
!! End of ~/.Xmodmap
karl@erlangen:~>