#include <keyboard.h>
Public Member Functions | |
| virtual void | setXKBModel (const QString &) |
| void | setXKBLayout (const QString &) |
| void | addXKBLayout (const QString &) |
| void | removeXKBLayout (const QString &) |
| void | setXKBOption (const QString &) |
| void | addXKBOption (const QString &) |
| void | removeXKBOption (const QString &) |
| void | setXKBVariant (const QString &, const QString &) |
| void | removeXKBVariant (const QString &) |
| void | setMapping (const QString &, const QString &) |
| QString | getXKBVariant (const QString &) |
| QString | getXKBModel (void) |
| QList< QString > | getXKBOptionList (void) |
| QList< QString > | getXKBLayout (void) |
| QList< QString > | getXKBVariantList (void) |
| QString | getDriver (void) |
| bool | selectKeyboard (int) |
| SaXManipulateKeyboard (SaXImport *, int=0) | |
The keyboard manipulator requires one import object (Keyboard) to become created. Once created the manipulator object is able to get/set specific keyboard options and is able to access the XKB file extension to know about the supported keyboards. The following example will demonstrate how to add an additional keyboard layout to the core layout:
#include <sax/sax.h> int main (void) { SaXException().setDebug (true); QDict<SaXImport> section; printf ("Importing data...\n"); SaXConfig* config = new SaXConfig; SaXImport* import = new SaXImport ( SAX_KEYBOARD ); import->setSource ( SAX_SYSTEM_CONFIG ); import->doImport(); config->addImport (import); section.insert ( import->getSectionName(),import ); printf ("Add czech keyboard layout...\n"); SaXManipulateKeyboard mKeyboard ( section["Keyboard"] ); if (mKeyboard.selectKeyboard (SAX_CORE_KBD)) { mKeyboard.addXKBLayout ("cz"); } printf ("Writing configuration\n"); config->setMode (SAX_MERGE); if ( ! config->createConfiguration() ) { printf ("%s\n",config->errorString().ascii()); printf ("%s\n",config->getParseErrorValue().ascii()); return 1; } return 0; }
Definition at line 201 of file keyboard.h.
| SaX::SaXManipulateKeyboard::SaXManipulateKeyboard | ( | SaXImport * | in, | |
| int | kbd = 0 | |||
| ) |
An object of this type is used to manipulate the keyboard settings refering to the X11 InputDevice sections. In contrast to pointer devices the keyboards are enumerated as 0,2,4,6,etc
Definition at line 186 of file keyboard.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excKeyboardImportBindFailed(), SaX::SaXException::excNullPointerArgument(), and SaX::SaXImport::getSectionID().
| void SaX::SaXManipulateKeyboard::setXKBModel | ( | const QString & | model | ) | [virtual] |
set global keyboard model to define the basic keyboard hardware type
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 231 of file keyboard.cpp.
| void SaX::SaXManipulateKeyboard::setXKBLayout | ( | const QString & | layout | ) | [virtual] |
set the basic keyboard layout. This method will overwrite the current layout setting
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 245 of file keyboard.cpp.
| void SaX::SaXManipulateKeyboard::addXKBLayout | ( | const QString & | layout | ) | [virtual] |
add a keyboard layout to the basic layout to be able to switch between different layouts. The first layout in the list defines the basic layout
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 259 of file keyboard.cpp.
| void SaX::SaXManipulateKeyboard::removeXKBLayout | ( | const QString & | layout | ) | [virtual] |
remove the given layout (layout) from the current list of keyboard layouts
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 280 of file keyboard.cpp.
| void SaX::SaXManipulateKeyboard::setXKBOption | ( | const QString & | option | ) | [virtual] |
set keyboard option. This will overwrite the current options list used for all keyboards
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 298 of file keyboard.cpp.
| void SaX::SaXManipulateKeyboard::addXKBOption | ( | const QString & | option | ) | [virtual] |
add a keyboard option to the current list of keyboard options
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 312 of file keyboard.cpp.
| void SaX::SaXManipulateKeyboard::removeXKBOption | ( | const QString & | option | ) | [virtual] |
remove a keyboard option. If the option (option) does not exist nothing will happen
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 332 of file keyboard.cpp.
| void SaX::SaXManipulateKeyboard::setXKBVariant | ( | const QString & | layout, | |
| const QString & | variant | |||
| ) | [virtual] |
set a variant for the given keyboard layout. If the layout has not been set an exception will be thrown.
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 350 of file keyboard.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excXKBLayoutUndefined(), getXKBLayout(), and getXKBVariantList().
Referenced by removeXKBVariant().
| void SaX::SaXManipulateKeyboard::removeXKBVariant | ( | const QString & | layout | ) | [virtual] |
remove the variant set for the layout (layout). This method simply call setXKBVariant() with an empty variant
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 388 of file keyboard.cpp.
References setXKBVariant().
| void SaX::SaXManipulateKeyboard::setMapping | ( | const QString & | type, | |
| const QString & | mapping | |||
| ) | [virtual] |
set mapping for the special keys Left/Right-Alt Scroll-Lock and Right Ctrl key. If wrong type or mappings are set an invalid argument exception will be thrown
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 399 of file keyboard.cpp.
References SaX::SaXException::errorString(), and SaX::SaXException::excInvalidArgument().
| QString SaX::SaXManipulateKeyboard::getXKBVariant | ( | const QString & | layout | ) | [virtual] |
return the variant defined for the given layout (layout) if there is no variant defined for the layout an empty string is returned. if the layout doesn't exist and exception will be throwed and an empty string is returned
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 497 of file keyboard.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excXKBLayoutUndefined(), and getXKBVariantList().
| QString SaX::SaXManipulateKeyboard::getXKBModel | ( | void | ) | [virtual] |
return the keyboard model name used for this keyboard. Only one model can be defined and active
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 528 of file keyboard.cpp.
| QList< QString > SaX::SaXManipulateKeyboard::getXKBOptionList | ( | void | ) | [virtual] |
return a list of XKB options set for the core keyboard
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 453 of file keyboard.cpp.
| QList< QString > SaX::SaXManipulateKeyboard::getXKBLayout | ( | void | ) | [virtual] |
return a list of XKB layouts set for the core keyboard the first element of the list os the core layout
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 467 of file keyboard.cpp.
Referenced by setXKBVariant().
| QList< QString > SaX::SaXManipulateKeyboard::getXKBVariantList | ( | void | ) | [virtual] |
return a list of variants following the list of defined keyboard layouts
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 482 of file keyboard.cpp.
Referenced by getXKBVariant(), and setXKBVariant().
| QString SaX::SaXManipulateKeyboard::getDriver | ( | void | ) | [virtual] |
return the driver used for this keyboard device
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 440 of file keyboard.cpp.
| bool SaX::SaXManipulateKeyboard::selectKeyboard | ( | int | ptr | ) | [virtual] |
select the keyboard device the changes should be applied to if the device does not exist (false) is returned
Implements SaX::SaXManipulateKeyboardIF.
Definition at line 213 of file keyboard.cpp.
1.5.3