YaST2 Developers Documentation: Keyboard

Keyboard

Keyboard.ycp
Provide information regarding the keyboard.
  • Thomas Roelz
  • Maintainer: Jiri Suchomel

This module has an unstable interface.

Usage: ------ This module provides the following data for public access via Keyboard::. !!! These are to be used READ_ONLY !!! Set in the constructor after the first import (only after probing): kb_model XkbLayout unique_key Set after having called SetKeyboard( keyboard ). XkbModel XkbVariant XkbOptions LeftAlt RightAlt ScrollLock RightCtl Apply keymap compose_table current_kbd ckb_cmd xkb_cmd This module provides the following functions for public access via Keyboard::(...) Keyboard() - Module constructor. If saved module data exists in continue mode, these are read in. Otherwise Hardware is probed. MakeProposal() - return user-readable description of keyboard Probe() - Force new hardware probing and set public data accordingly. Save() - Save module data to /var/lib/YaST2/Keyboard_data.ycp Restore() - Load module data from /var/lib/YaST2/Keyboard_data.ycp SetKeyboard() - Set public data to values corresponding to the given language. GetKeyboardForLanguage() - Get the keyboard language for a given language code. Set() - Set the keyboard to the given keyboard language. SetConsole() - Set the console keyboard to the given keyboard language. SetX11() - Set the X11 keyboard to the given keyboard language. Selection() - Get map of translated keyboards to be displayed in the GUI.

Imports

  • Arch
  • AsciiFile
  • Directory
  • HTML
  • Label
  • Language
  • Linuxrc
  • Misc
  • Mode
  • Package
  • ProductFeatures
  • Stage
  • XVersion

Global Variables

Global Functions

Local Functions

global keyboard_on_entry -> string

keyboard set on start

global expert_on_entry -> map

expert values on start

local GetKbdSysconfig () -> void

GetKbdSysconfig()

global keymap2yast () -> map<string, string>

Return a map for conversion from keymap to YaST2 keyboard code() Get the map of translated keyboard names.

Return value:
of $[ keyboard_code : keyboard_name, ...] for all known keyboards. 'keyboard_code' is used internally in Set and Get functions. 'keyboard_name' is a user-readable string. Uses Language::language for translation.
global GetX11KeyData (string keymap) -> map

GetX11KeyData()

Get the keyboard info for X11 for the given keymap

Parameters:
keymap
Return value:
containing the x11 config data
local GetKeyboardName (string kbd) -> string

Return human readable (and translated) name of the given keyboard map

Parameters:
kbd keyboard map
global GetExpertValues () -> map

GetExpertValues()

Return the values for the various expert settings in a map

Return value:
with values filled in
global get_lang2keyboard () -> map

Get the system_language --> keyboard_language conversion map.

Return value:
conversion map
See
get_xkblayout2keyboard()
global GetKeyboardForLanguage (string sys_language, string default_keyboard) -> string

GetKeyboardForLanguage()

Get the keyboard language for the given system language.

Parameters:
sys_language
default_keyboard
Return value:
The keyboard language for this language, e.g. "english-us" or the default value if nothing found.
local x11_setup_needed () -> boolean

run X11 configuration after inital boot

global SetKeyboard (string keyboard) -> boolean

SetKeyboard()

Set language specific module data to reflect the given keyboard layout.

Parameters:
keyboard
Return value:
true - Success. Language set in public data. false - Error. Language not set.
global Restore () -> boolean

Restore the the data from sysconfig.

Return value:
true - Data could be restored false - Restore not successful
See
Save()
local XkblayoutToKeyboard (string x11_layout) -> string

XkblayoutToKeyboard()

Convert X11 keyboard layout name to yast2 name for keyboard description. e.g. "de" --> "german"

Parameters:
x11_layout
Return value:
yast2 name for keyboard description
local probe_settings () -> void

Probe keyboard and set local module data.

global Probe () -> void

Probe()

Allow for intentional probing by applications.

See
Keyboard()
global Keyboard () -> void

Keyboard()

The module constructor. Sets the proprietary module data defined globally for public access. This is done only once (and automatically) when the module is loaded for the first time.

See
Probe()
global Read () -> boolean

Just store inital values - read was done in constructor

global Modified () -> boolean

was anything modified?

global Save () -> void

Save the current data into a file to be read after a reboot.

global Name () -> string

Name() Just return the keyboard name, without setting anything.

Return value:
user readable description.
global SetConsole (string keyboard) -> string

Set the console keyboard to the given keyboard language.

Parameters:
keyboard
Return value:
The loadkeys command that has been executed to do it. (also stored in Keyboard::ckb_cmd)
global SetX11 (string keyboard) -> string

Set the X11 keyboard to the given keyboard language.

Parameters:
keyboard
Return value:
The xkbset command that has been executed to do it. (also stored in Keyboard::xkb_cmd)
global Set (string keyboard) -> void

Set()

Set the keyboard to the given keyboard language.

Parameters:
keyboard
Return value:
See
SetX11(), SetConsole()
global MakeProposal (boolean force_reset, boolean language_changed) -> string

MakeProposal()

Return proposal string and set system keyboard.

Parameters:
force_reset
language_changed
Return value:
user readable description. If force_reset is true reset the module to the keyboard stored in default_kbd.
global CalledRestore () -> boolean

CalledRestore()

Return if the kbd values have already been read from /etc/sysconfig/keyboard

global Selection () -> map<string, string>

Selection()

Get the map of translated keyboard names.

Return value:
of $[ keyboard_code : keyboard_name, ...] for all known keyboards. 'keyboard_code' is used internally in Set and Get functions. 'keyboard_name' is a user-readable string.
global GetKeyboardItems () -> list<term>

Return item list of keyboard items, sorted according to current language

global SetExpertValues (map val) -> void

SetExpertValues()

Set the values of the various expert setting

Parameters:
val map with new values of expert settings
global CheckKeyboardDuringUpdate (string destdir) -> void

Special function for update mode only. Checks for the keyboard layout on the system which should be updated and if it differs from current one, opens a popup with the offer to change the layout. See discussion in bug #71069

Parameters:
destdir path to the mounted system to update (e.g. "/mnt")
global Import (map settings) -> boolean

AutoYaST interface function: Get the Keyboard configuration from a map.

Parameters:
settings imported map
Return value:
success
global Export () -> map

AutoYaST interface function: Return the Keyboard configuration as a map.

Return value:
with the settings
global Summary () -> string

AutoYaST interface function: Return the summary of Keyboard configuration as a map.

Return value:
summary string (html)