YaST2 Developers Documentation: Keyboard



functions
files
intro

Keyboard

Keyboard.ycp
Provide information regarding the keyboard.
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 SetLanguage( keyboard ). XkbRules XkbModel Protocol XkbKeyCodes 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 SetLanguage() - 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
  • Language
  • Misc
  • Mode
  • ProductFeatures

Global Functions

Local Functions

Info:

GetKbdSysconfig() Restore the the non-keyboard values from sysconfig. @param -

Return value:
-

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

global SetLanguage (string keyboard) -> boolean

SetLanguage() Set language specific module data to reflect the given language.

Parameters:
keyboard
Return value:
true - Success. Language set in public data. false - Error. Language not set.

global Restore () -> boolean

Restore() Restore the the data from sysconfig. @param -

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

global GetKeyboardForLanguage (string sys_language, string default_language) -> string

GetKeyboardForLanguage() Get the keyboard language for the given system language.

Parameters:
sys_language
default_language
Return value:
The keyboard language for this language, e.g. "english-us" or the default value if nothing found.

global Probe () -> void

Probe() Allow for intentional probing by applications. @param -

Return value:
-
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. @param -

Return value:
-
See:
Probe()

global xf86_update () -> integer

xf86_update() Updates the keyboard settings in the XF86Config file. !!! only XFree 4 !!! @param -

Return value:
true - success false - failure
See:
create_info_map()

global Save (boolean update_x11) -> void

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

Parameters:
update_x11
Return value:
-
See:
Restore()

global X11SetLanguage (string x11_layout) -> void

X11SetLanguage() Set sysconfig variable YAST_LANGUAGE according to the given X11 layout name e.g. "de" --> "german". Save the settings without writing XF86config

Parameters:
x11_layout

global Name () -> string

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

Return value:
user readable description.

global SetConsole (string keyboard) -> string

SetConsole() 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)
See:
SetX11()

global SetX11 (string keyboard) -> string

SetX11() 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)
See:
SetConsole()

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. @param -

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.
See:
-

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

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

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.

YaST2 Developers Documentation