Differences between revisions 1 and 41 (spanning 40 versions)
Revision 1 as of 2008-02-03 18:09:26
Size: 1165
Comment:
Revision 41 as of 2019-07-17 09:06:47
Size: 6749
Editor: ?DavidBanks
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
## ##############################################################
##
## More informations on "DebianWiki/EditorGuide" article
## Don't use all this template, just what you need !
##
## ##############################################################
##
||<tablestyle="width: 100%;" style="border: 0px hidden">~-Translation(s): none-~ ||<style="text-align: right; border: 0px hidden"> (!) [:/Discussion:Discussion]||
[[BR]]
||<tablestyle="width: 100%; text-align: center; border: 0px hidden"> http://www.debian.org/logos/openlogo-nd-50.png http://www.debian.org/Pics/debian.png||
||<style="border: 0px hidden">~+inline:Portal/IDB/logo_portal.png Welcome to ["Debian"] Keyboard+~||
~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[fr/Keyboard|Français]] - [[it/Keyboard|Italiano]] - [[ru/Keyboard|Русский]] -~
Line 14: Line 4:
inline:Portal/IDB/icon-template-32x32.png This portal talk about keyboards. Technical language could be used, but explained.
----
||<tablestyle="width: 100%; text-align: center; border: 0px hidden"> {{https://www.debian.org/logos/openlogo-nd-50.png}} {{https://www.debian.org/Pics/debian.png}}||
||<style="border: 0px hidden">~+{{attachment:Portal/IDB/logo_portal.png}} Welcome to the [[Debian]] portal for keyboard information +~||
## For long page, you can use a TOC
<<TableOfContents(2)>>
Line 17: Line 9:
## For long portal, you can use a TOC
## [[TableOfContents(2)]]
== Keyboard configuration ==
Line 20: Line 11:
 * [:/MultimediaKeys:Configure additionnal multimedia key] To configure the keyboard, you have to install DebianPkg:keyboard-configuration. The package DebianPkg:console-setup is also needed.
Line 22: Line 13:
## == Waiting for rectification ==
## Pages need works like merging, ambiguous
Line 25: Line 14:
----
## - If this page belongs to an existing Category, add it below.
 CategoryPortal | CategoryKeyboard
The keyboard settings are stored in '''{{{/etc/default/keyboard}}}''' file. It's provided by DebPkg:keyboard-configuration package, and other packages use this information in order to configure the keyboard on the console or in X Window System.

You can change your keyboard settings using:
{{{
# dpkg-reconfigure keyboard-configuration
# service keyboard-setup restart
}}}

As usual, it will prompt you for the ''model'' of keyboard (what the keyboard ''*is*''), and then for the keyboard ''layout'' (what the keys should ''*do*''). Use this tool to change your keyboard map, e. g. from ''QWERTY'' to ''QWERTZ'' or to ''Dvorak'', or for non-English layouts.

To apply new settings, restarting the {{{keyboard-setup}}} service should suffice, otherwise you can try to restart kernel input system via udev:
{{{
udevadm trigger --subsystem-match=input --action=change
}}}
or reboot the whole OS.

You can also edit {{{/etc/default/keyboard}}} manually, here's an example:
{{{
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us,de,fr,ua,ru"
XKBVARIANT=""
XKBOPTIONS="grp:alt_shift_toggle"

BACKSPACE="guess"
}}}

 * XKBMODEL is a keyboard model variable (look at a {{{/usr/share/X11/xkb/rules/base.lst}}} (plain text) or {{{/usr/share/X11/xkb/rules/base.xml}}} (XML) for a full list);
 * XKBLAYOUT variable contains a list of used layouts;
 * "grp:alt_shift_toggle" sets a layout switching key combination (<Alt>+<Shift>).

See also:
 * [[DebianMan:5/keyboard|keyboard(5)]] man page.
 * Keyboard layout (keymap) section in [[http://www.debian.org/doc/manuals/debian-reference/ch08.en.html#_the_keyboard_input|debian-reference]] ("{{{dpkg-reconfigure --priority=low xserver-xorg}}}" command suggested by the page linked above does not work in Squeeze. You may try to add something like "{{{setxkbmap us,ru -option grp:ctrl_shift_toggle}}}" into {{{~/.xsessionrc}}} instead).
 * [[/MultimediaKeys|Configure additional multimedia keys]].

== How to set keyboard layout in initramfs ==

The appropriate section of {{{/etc/initramfs-tools/initramfs.conf}}} needs to be changed to have a localized keyboard layout at boot time:
{{{
#
# KEYMAP: [ y | n ]
#
# Load a keymap during the initramfs stage.
#

KEYMAP=y
}}}

Apply changes:
{{{
# update-initramfs -u
}}}

== How to enable USB keyboard in initramfs ==

The initramfs-tools must include the {{{usbhid}}} module and its dependencies for USB keyboard support at boot time. Either the configuration file {{{/etc/initramfs-tools/conf.d/driver-policy}}} must include most modules, or they will have to be specified in another file:
{{{
#
# MODULES: [ most | netboot | dep | list ]
#
# most - Add most filesystem and all harddrive drivers.
#
# dep - Try and guess which modules to load.
#
# netboot - Add the base modules, network modules, but skip block devices.
#
# list - Only include modules from the 'additional modules' list
#

MODULES=most
}}}

If the configuration above was not set to include most modules, then the necessary modules have to be specified in the file {{{/etc/initramfs-tools/modules}}}:
{{{
# USB keyboard at boot
usbcore
uhci_hcd
ehci_hcd
usbhid
}}}

Apply changes:
{{{
# update-initramfs -u
}}}

== How to switch a keyboard layout in X11 / graphical desktop environment ==

{{{#!wiki caution
There is much on this page that is out of date for Stretch - needs a total rewrite by someone that knows more than I do. The names for the international keyboard layouts changed between jessie and stretch - not finding documentation. ).
}}}

=== GNOME ===

These layouts include minor languages and dialects, as well as very specific configurations, and are hidden by default in the GUI.
The only way to make them visible is to enable the corresponding setting in gconf:
{{{
$ gsettings set org.gnome.desktop.input-sources show-all-sources true
}}}

For more information on this issue see [[https://bugzilla.gnome.org/show_bug.cgi?id=682240]].

=== KDE ===

KDE does this via System_settings/Hardware/Input_devices/keyboard - Most people doing dual languages will simply select the correct keyboard model and then go to the layout tab and select English(US International AltGr Unicode combining,alternative ).

Use your favorite desktop keyboard layout switcher applet.

=== Generic / Terminal ===

You can also switch the layout from the terminal, e. g.:
{{{
$ setxkbmap de
$ setxkbmap fr
$ setxkbmap us
}}}

Of special interest for keyboard hardware with us layout might be the ''altgr-intl'' variant (this provides a simple !AltGr mapping for many umlauts and special symbols):
{{{
$ setxkbmap -rules evdev -model evdev -layout us -variant altgr-intl
}}}
or
{{{
$ setxkbmap -model pc105 -layout us -variant altgr-intl
}}}

To configure a simple key for toggling between multiple configured keyboard layouts, see Option !XkbOptions in Section !InputClass somewhere within the xorg config file collection (see [[https://forums.freebsd.org/threads/solved-setxkbmap-xinitrc.48412/#post-270733|[SOLVED] Setxkbmap .xinitrc]]).

== Troubleshooting ==

If changes to {{{/etc/default/keyboard}}} do not apply after restarting, it is possible that the changes are being overridden by gsettings. For instance, if XKBOPTIONS set in {{{/etc/default/keyboard}}} are not working, check using:
{{{
gsettings get org.gnome.desktop.input-sources xkb-options
}}}
and reset if necessary:
{{{
gsettings reset org.gnome.desktop.input-sources xkb-options
}}}

IBus can also sometimes override settings from {{{/etc/default/keyboard}}}. The keyboard setup dialog in GNOME 3 will modify IBus's configuration directly, but for users of other X environments, you can use the {{{ibus-setup}}} command to modify the settings for IBus. To force it to defer to the settings from {{{/etc/default/keyboard}}}, run {{{ibus-setup}}}, go to the ''Advanced'' tab, and check ''Use system keyboard layout''.

Translation(s): English - Français - Italiano - Русский


https://www.debian.org/logos/openlogo-nd-50.png https://www.debian.org/Pics/debian.png

Portal/IDB/logo_portal.png Welcome to the Debian portal for keyboard information

Keyboard configuration

To configure the keyboard, you have to install keyboard-configuration. The package console-setup is also needed.

The keyboard settings are stored in /etc/default/keyboard file. It's provided by keyboard-configuration package, and other packages use this information in order to configure the keyboard on the console or in X Window System.

You can change your keyboard settings using:

# dpkg-reconfigure keyboard-configuration
# service keyboard-setup restart

As usual, it will prompt you for the model of keyboard (what the keyboard *is*), and then for the keyboard layout (what the keys should *do*). Use this tool to change your keyboard map, e. g. from QWERTY to QWERTZ or to Dvorak, or for non-English layouts.

To apply new settings, restarting the keyboard-setup service should suffice, otherwise you can try to restart kernel input system via udev:

udevadm trigger --subsystem-match=input --action=change

or reboot the whole OS.

You can also edit /etc/default/keyboard manually, here's an example:

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us,de,fr,ua,ru"
XKBVARIANT=""
XKBOPTIONS="grp:alt_shift_toggle"

BACKSPACE="guess"
  • XKBMODEL is a keyboard model variable (look at a /usr/share/X11/xkb/rules/base.lst (plain text) or /usr/share/X11/xkb/rules/base.xml (XML) for a full list);

  • XKBLAYOUT variable contains a list of used layouts;
  • "grp:alt_shift_toggle" sets a layout switching key combination (<Alt>+<Shift>).

See also:

  • keyboard(5) man page.

  • Keyboard layout (keymap) section in debian-reference ("dpkg-reconfigure --priority=low xserver-xorg" command suggested by the page linked above does not work in Squeeze. You may try to add something like "setxkbmap us,ru -option grp:ctrl_shift_toggle" into ~/.xsessionrc instead).

  • Configure additional multimedia keys.

How to set keyboard layout in initramfs

The appropriate section of /etc/initramfs-tools/initramfs.conf needs to be changed to have a localized keyboard layout at boot time:

#
# KEYMAP: [ y | n ]
#
# Load a keymap during the initramfs stage.
#

KEYMAP=y

Apply changes:

# update-initramfs -u

How to enable USB keyboard in initramfs

The initramfs-tools must include the usbhid module and its dependencies for USB keyboard support at boot time. Either the configuration file /etc/initramfs-tools/conf.d/driver-policy must include most modules, or they will have to be specified in another file:

#
# MODULES: [ most | netboot | dep | list ]
#
# most - Add most filesystem and all harddrive drivers.
#
# dep - Try and guess which modules to load.
#
# netboot - Add the base modules, network modules, but skip block devices.
#
# list - Only include modules from the 'additional modules' list
#

MODULES=most

If the configuration above was not set to include most modules, then the necessary modules have to be specified in the file /etc/initramfs-tools/modules:

# USB keyboard at boot
usbcore
uhci_hcd
ehci_hcd
usbhid

Apply changes:

# update-initramfs -u

How to switch a keyboard layout in X11 / graphical desktop environment

There is much on this page that is out of date for Stretch - needs a total rewrite by someone that knows more than I do. The names for the international keyboard layouts changed between jessie and stretch - not finding documentation. ).

GNOME

These layouts include minor languages and dialects, as well as very specific configurations, and are hidden by default in the GUI. The only way to make them visible is to enable the corresponding setting in gconf:

$ gsettings set org.gnome.desktop.input-sources show-all-sources true

For more information on this issue see https://bugzilla.gnome.org/show_bug.cgi?id=682240.

KDE

KDE does this via System_settings/Hardware/Input_devices/keyboard - Most people doing dual languages will simply select the correct keyboard model and then go to the layout tab and select English(US International ?AltGr Unicode combining,alternative ).

Use your favorite desktop keyboard layout switcher applet.

Generic / Terminal

You can also switch the layout from the terminal, e. g.:

$ setxkbmap de
$ setxkbmap fr
$ setxkbmap us

Of special interest for keyboard hardware with us layout might be the altgr-intl variant (this provides a simple AltGr mapping for many umlauts and special symbols):

$ setxkbmap -rules evdev -model evdev -layout us -variant altgr-intl

or

$ setxkbmap -model pc105 -layout us -variant altgr-intl

To configure a simple key for toggling between multiple configured keyboard layouts, see Option XkbOptions in Section InputClass somewhere within the xorg config file collection (see [SOLVED] Setxkbmap .xinitrc).

Troubleshooting

If changes to /etc/default/keyboard do not apply after restarting, it is possible that the changes are being overridden by gsettings. For instance, if XKBOPTIONS set in /etc/default/keyboard are not working, check using:

gsettings get org.gnome.desktop.input-sources xkb-options

and reset if necessary:

gsettings reset org.gnome.desktop.input-sources xkb-options

IBus can also sometimes override settings from /etc/default/keyboard. The keyboard setup dialog in GNOME 3 will modify IBus's configuration directly, but for users of other X environments, you can use the ibus-setup command to modify the settings for IBus. To force it to defer to the settings from /etc/default/keyboard, run ibus-setup, go to the Advanced tab, and check Use system keyboard layout.