Class e.p.p.w.o.Key(object):

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:

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.
def __init__(self, ktype, kwidth, kvalues=None, label=None, image=None):
Constructor.
Parametersktypethe type of the key (one of (Key.CHAR, Key.SWITCH, Key.DELETE, Key.PLACEHOLDER, Key.MISC)) (type: str )
kwidththe 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 )
kvaluesthe value of the key (depends on its type).
  • if ktype is Key.CHAR, then kvalues is a dict associating each cap to a string value
  • if ktype is Key.SWITCH, then kvalues is a list of caps to cycle through when switching
  • if ktype is Key.DELETE, then kvalues is ignored
  • if ktype is Key.PLACEHOLDER, then kvalues is ignored
  • if ktype is Key.MISC, then kvalues is a miscellaneous string value
(type: dict of str, or list of str, or None, or str )
labelthe label to display on the graphical representation of the key (type: str )
imagean optional image resource to display on the graphical representation of the key (type: str )
def to_xml(self, document):
Dump the key to an XML node.
Parametersdocumentthe XML document for which to generate the node (type: xml.dom.minidom.Document )
Returnsan XML node representing the key (type: xml.dom.minidom.Element )
@classmethod
def from_xml(cls, key_node, caps):
Instantiate a key from its XML representation.
Parameterskey_nodethe XML representation of the key (type: xml.dom.minidom.Element )
capsthe list of caps of the keyboard (type: list of str )
Returnsa key (type: Key )
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.