The D-Series phones provide a set of user definable keys. For D-100 and D-200 the user can define 18 self labeling keys. These are aligned in 3 layers to each side of the display.

The XT20 modules provide 60 self labeling keys. It displays 20 keys on 3 layers.

The user can set the keys from a set of templates. Via Provisioning it is possible to configure keys directly and also provide a set of custom Configuration templates for the user.

A key can contain invocations, reactions, and a Lua script.

The phone invokes each configured invocation on key press. Each reaction can modify the led state of the configured key. The last led state persists.



In contrast to the somewhat limited possibilities of the xml defined keys, you can also provide a lua script.

The script is defined for a specific key and has control over the key press and the LED state of said key. The environment contains interfaces to invoke calls, prepare subscriptions, send http requests or register handlers for incoming http. The key can keep a state during the phones activity and is therefore able to perform more complex tasks than the stateless xml configuration.

The environment uses a Lua 5.2. The basic functions and modules ''bit32'', ''math'', ''string'' and ''table'' are available.

Furthermore, there is a phone specific Lua API.


      --[===]simple script used for setting LEDs[===]--
      local state = 0
      --[===]onKeyUp is called when the key is released[===]--
      function onKeyUp()
        state = (state + 1) % 7
        if state == 0  then
            --[===]set the configured key LED to off[===]--
            key:setLed( "off" )
        elseif state == 1 then
            key:setLed( "red" )
        elseif state == 2 then
            key:setLed( "red", true )
        elseif state == 3 then
            key:setLed( "orange" )
        elseif state == 4 then
            key:setLed( "orange", true )
        elseif state == 5 then
            key:setLed( "green" )
            key:setLed( "green", true )

The configuration can define parameters, which will be added to the Environment. An Example for this is given in the Configuration templates.