Xwin Keymap

0 views
Skip to first unread message

Maribeth Seagers

unread,
Aug 5, 2024, 3:09:14 PM8/5/24
to abtramporte
Thisarticle describes the basics of Xorg keyboard configuration. For advanced topics such as keyboard layout modification or additional key mappings, see X keyboard extension or Extra keyboard keys respectively.

The Xorg server uses the X keyboard extension (XKB) to define keyboard layouts. Optionally, xmodmap can be used to access the internal keymap table directly, although this is not recommended for complex tasks. Also systemd's localectl can be used to define the keyboard layout for both the Xorg server and the virtual console.


The layout name is usually a 2-letter country code. To see a full list of keyboard models, layouts, variants and options, along with a short description, open /usr/share/X11/xkb/rules/base.lst. Alternatively, you may use one of the following commands to see a list without a description:


Examples in the following subsections will have the same effect, they will set pc104 model, cz as primary layout, us as secondary layout, dvorak variant for us layout and the Win+Space combination for switching between layouts. See xkeyboard-config(7) for more detailed information.


setxkbmap sets the keyboard layout for the current X session only, but can be made persistent in xinitrc or xprofile. This overrides system-wide configuration specified following #Using X configuration files. However, persistence does not apply to keyboards such as external keyboards, unless their device id was specified when setxkbmap was run. Or that they are the core keyboard device of the X server.


For convenience, the tool localectl may be used instead of manually editing X configuration files. It will save the configuration in /etc/X11/xorg.conf.d/00-keyboard.conf, this file should not be manually edited, because localectl will overwrite the changes on next start.


To set a model, variant or options, all preceding fields need to be specified, but the preceding fields can be skipped by passing an empty string with "". Unless the --no-convert option is passed, the specified keymap is also converted to the closest matching console keymap and applied to the console configuration in vconsole.conf. See localectl(1) for more information.


However, there is a known issue with XKB that causes other shortcuts of the type Alt+Shift+any_key to break. Moreover, XKB may set the right Alt to be AltGr by default in some keyboard layouts, making RAlt+RShift not working for layout switching.


By default, the key combination Ctrl+Alt+Backspace is disabled. You can enable it by passing terminate:ctrl_alt_bksp to XkbOptions. This can also be done by binding a key to Terminate_Server in xmodmap (which undoes any existing XkbOptions setting). In order for either method to work, one also needs to have DontZap set to "off" in ServerFlags: since 2004 [2] this is the default.


Mouse keys, not to be confused with the keys of the mouse, is disabled by default and has to be manually enabled by passing keypad:pointerkeys to XkbOptions. This will make the Shift+NumLock shortcut toggle mouse keys.


Though a few more eccentric keyboards feature a Compose key, its availability is usually through substituting an already existing key to it. For example, to make the Menu key a Compose key use the Desktop environment configuration, or pass compose:menu to XkbOptions (or setxkbmap: setxkbmap -option compose:menu). Allowed key substitutions are defined in /usr/share/X11/xkb/rules/base.lst:


If the desired mapping is not found in that file, an alternative is to use xmodmap to map the desired key to the Multi_key keysym, which acts as a compose key by default (note that xmodmap settings are reset by setxkbmap).


Those who prefer typing capital letters with the Caps Lock key may experience a short delay when Caps Lock state is switched, resulting in two or more capital letters (e.g. THe, ARch LInux). This occurs because Caps Lock is enabled immediately once the Caps Lock key is pressed, but is only disabled upon release of the second key-press. This behaviour stems from typewriters where a Caps Lock function was achieved by physically locking the shifted typebars in place, and the release of a shift key-press was the action that caused the release of the lock.


Some more popular operating systems have removed this behaviour, either voluntarily (as it can be confusing to some) or by mistake, however this is a question of preference. Bug reports have been filed on the Xserver bug tracker, as there is currently no easy way to switch to the behaviour reflected by those other operating systems. For anyone who would like to follow up the issue, bug reports and latest working progress can be found at [3] and [4].


To assign an additional one-click function to a modifier key, you can use xcape. For example it is possible to have CapsLock work as Escape when pressed alone, and as Control when used with another key. First set the Control swapping using setxkbmap as mentioned earlier, and xcape to set the Escape association:


The typematic delay indicates the amount of time (typically in milliseconds) a key needs to be pressed and held in order for the repeating process to begin. After the repeating process has been triggered, the character will be repeated with a certain frequency (usually given in Hz) specified by the typematic rate. Note that these settings are configured separately for Xorg and for the virtual console.


The tool xset, provided by xorg-xset, can be used to set the typematic delay and rate for an active X server, though certain actions during runtime may cause the X server to reset these changes and revert instead to its seat defaults.


A guide for polyglots to use Cyrillic letters, Chinesecharacters, Arabic, Latin letters and any other language in Linux, with theability to easily switch between them in an X11 graphical environmentor console.


There are several input methods that can be used, just a plainusage of xkb which just changes keyboard layouts or more completemethods which include spell checkers, character and word suggestions,and support for Asiatic scripts like ibus.


To see a list of word suggestions when typing a word, you need tofirst choose the language you want at the ibus selection window, andthen choose ibus-typing-booster[^ibus-typing-booster] from the samewindow.


And to see specifically the mappings it has, consult the properlayout file, e.g. for Russian (ru): /usr/share/X11/xkb/symbols/ruand locate the xkb_symbols "phonetic". It will have all the keymappings like: key [ Cyrillic_te, Cyrillic_TE ] ;where it specifies that the Latin T key will be the Cyrillicversion: т.


It already comes with a list of possible key combinations that will beswitching between all the specified layouts listed in /usr/share/X11/xkb/rules/base.lst, starting with grp: andending with toggle.


I'm just talking about the standard KDE desktop. After a while (many days) of running the task bar stops working properly. This is due to some sort of undiagnosed bug but that's really not my boggle at the moment. It's fixed as soon as I log out and in again.


In KDE5 use "kstart plasmashell" to restart the plasmashell as a service instead of plasmashell &. If you use it that way it 's run as an independed service not connected to the current terminal session (meaning you can close the terminal without the process getting terminated). TLDR:


I looked this up because I had an issue where I couldn't open any KDE settings menus, but I didn't really want to reboot or log out. I found that the best way to do it (in KDE 5 at least) is by using krunner (Alt+F2) to killall plasmashell then immediately afterwards, plasmashell. I tried doing it in a Konsole window, using killall plasmashell and then plasmashell & and this worked, but as soon as I closed the Konsole window, plasma would close as well. Even though you seemed to resolve your issue, I figured I would post it for people coming along in the future needing to restart plasma.


OK .. I am running OpenSuse Leap 15.1 running KDE5 Plasma. Periodically, my X environment is corrupted (after about 24 hours of leaving my machine running) and I get"KLauncher could not be reached via D-Bus. Error when calling start_service_by_desktop_path: Not connected to D-Bus server"


The result of this is that while my desktop still functions I can't launch any applications which use KLauncher -- very annoying. (NOTE: also my xwindows vncserver appears to launch 99 instances of display windows I could attach to -- which isnt right -- I havent corrected this yet but I will). However, I FOUND the answer to the above issue to restart KDE 5 Plasma in my environment without a reboot:


Finally, I've noticed that, when type 'kwinplasma' in KSysGuard filter field, it reports that after killing plasmashell, such *.so files are still present: desktop.so, file.so. We must kill them too. Otherwise, we'll have copies of that files after each restart.


In KDE4 I find the memory usage ramps up to around a gigglebite pretty rapidly because opening programs progressively uses more RAM, but closing them does not release it. This is in Mint 17.3 with KDE but seems to affect pretty well ALL KDE plasma 4 systems.


I think the RDP issue with the keyboard layout you are having is a tightVNC issue. Does the information in the following link describe what you are experiencing? Do you absolutely need a graphical session to the beaglebone?

-mapping-wrong-only-in-specific-applications-under-tightvnc

_keyboard_mapping_with_tightvnc/

!topic/beagleboard/YCiECD0fiII


If your operating system keyboard settings are correct, it is still a VNC or Xkeybord issue, can you try setting the Xkeyboard default keyboard to US keyboard via terminal command line "setxkbmap us", where "us" would be US for US keyboard :

-change-keyboard-layout-inside-vncserver


Per the manual page, if the configuration is not the same on the client and the server, you can have keyboard mapping issues. I suggest reading the note at the bottom of the manual regarding xkbcomp on the client side:

3a8082e126
Reply all
Reply to author
Forward
0 new messages