Part of elisa.plugins.pigment.widgets.osk View In Hierarchy
One given key of a virtual keyboard. A key has a type that determines its behaviour when activated:
Key.CHAR
: a normal character
Key.SWITCH
: switch between caps
Key.DELETE
: backspace
Key.PLACEHOLDER
: an invisible key
Key.MISC
: a key with a miscellaneous behaviour
Line # | Kind | Name | Docs |
---|---|---|---|
61 | Method | __init__ | Constructor. |
98 | Method | to_xml | Dump the key to an XML node. |
126 | Class Method | from_xml | Instantiate a key from its XML representation. |
Parameters | ktype | the type of the key (one of (Key.CHAR ,
Key.SWITCH , Key.DELETE ,
Key.PLACEHOLDER , Key.MISC ))
(type: str
) |
kwidth | the relative width of the key on the row (must be between 0.0 and 1.0, the
sum of the widths of the key on one row should not exceed 1.0)
(type: float
) | |
kvalues | the value of the key (depends on its type).
dict of str , or list of
str , or None , or str
) | |
label | the label to display on the graphical representation of the key
(type: str
) | |
image | an optional image resource to display on the graphical representation of
the key
(type: str
) |
Parameters | document | the XML document for which to generate the node
(type: xml.dom.minidom.Document
) |
Returns | an XML node representing the key
(type: xml.dom.minidom.Element
) |
Parameters | key_node | the XML representation of the key
(type: xml.dom.minidom.Element
) |
caps | the list of caps of the keyboard
(type: list of str
) | |
Returns | a key
(type: Key
) |