Skip to content

Templates#

Howto's#

Defaults#

Commented File-structure#

templates.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- A list of templates.
     type: list -->
<templates version="1.34.0">
  <!-- A template describes a functionality that can be placed on a key.
       Foremost it describes how a key works, how the LED is set and what
       happens when key is pressed. It also carries a list of parameters
       that need to be filled when this function is assigned to key.
       parameters:
         name: Text identifying the Template. Has to be unique.
               Will be referenced in key structure to store which template was used.
               Free usable text or android resource tag starting with "@string/"
               type: string
         prio: Priority of this template when presenting a list to choose the function-type a key.
               The higher the number, the higher this type is placed in the list.
               type: integer
         description: type: string
         icon: The icon of the key, base64 encoded.
               The icon is scaled to fit the display container.
               If starting with @drawable/ a android resource is used
               type: string
         label: When set this will be the default-label for a key of this type.
                Can be set to refer to a value of a specific parameter via
                "@param-@string/paramName"
                type: string -->
  <template name="" prio="10" description="" icon="" label="">
    <!-- Various configuration parameters for a functionkey.
         This can either be:
         - lua code
         - a line (obsolete though still used, will be replaced by lua code)
         - a list of functions assigned to the key (obsolete though still used,
           will be replaced by lua code) -->
    <keyConfiguration>
      <lua>
        <!-- a lua-script
             type: string -->
        <code></code>
        <!-- type: list -->
        <params>
          <!-- A parameter for lua scripts to be set by the template.
               parameters:
                 name: type: string -->
          <param name="">
            <!-- type: string -->
            <value></value>
          </param>
        </params>
      </lua>
    </keyConfiguration>
    <!-- type: list -->
    <parameters>
      <!-- parameters:
             name: Identifies the parameter. Has to be unique.
                   Free usable text or android resource tag starting with "@string/"
                   type: string
             type: Type for this field. Defaults to "text" if unspecified.
                   If set to "identity", must be a valid identity index, and will
                   show an identity chooser in configuration UI.
                   type: enum
                   accepted values:
                     text
                     boolean
                     identity
                     sip_uri
                     web_uri
                     number
                     phone
             min: Minimum value (for type number) or length (for type text)
                  type: integer
             max: Maximum value (for type number) or length (for type text)
                  type: integer
             description: type: string
             optional: Optional parameters may be left empty, the save-button in PUI
                       will work without them.
                       type: boolean -->
      <parameter name="" type="text" min="0" max="0" description="" optional="false">
        <!-- List of x-path within the key structure where the value of the
             parameter is to be inserted into.
             type: list
             minimum: 1 element -->
        <path>
        </path>
        <!-- For parameters of types text, sip_uri, web_uri, number or phoneList:
             Optionally define which values are allowed (offers combo-box in UI).
             If empty, all values are allowed.
             type: list -->
        <choices>
          <choice>
            <!-- type: string -->
            <value></value>
            <!-- type: string -->
            <description></description>
          </choice>
        </choices>
      </parameter>
    </parameters>
  </template>
</templates>