Touch Device#
A TouchDevice object is returned from get_touch_device.
Member functions#
The following are member functions of TouchDevice objects.
set_control_value#
set_control_value(name, [index,] value[, emitChange])
Set the value on a Touch Slider or Colour Picker according to the parameters:
Parameter |
Value Type |
Description |
Value Example |
|---|---|---|---|
|
string |
The Key of the Touch Control. |
|
|
integer (1-3) |
Optional. Axis of movement - a slider has 1; a colour picker has 3. Will default to 1 if this parameter isn’t specified. |
|
|
integer (0-255) |
New value to set. |
|
|
boolean |
Optional. Whether to fire associated triggers as a result of the control value change. Defaults to |
|
For example:
-- Set slider001 to half (and don't fire any associated triggers) on TPS 1
get_touch_device(TPS, 1):set_control_value("slider001", 128)
-- Set the second axis (green) to full on colour020 on TPS5 2
get_touch_device(TPS5, 2):set_control_value("colour020", 2, 255)
set_control_state#
set_control_state(name, state)
Set the state on a Touch control according to the parameters:
Parameter |
Value Type |
Description |
Value Example |
|---|---|---|---|
|
string |
The Key of the Touch Control. |
|
|
string |
The name of the state as defined in the Touch theme. |
|
For example:
-- Set slider001 to a state called "Green" on TPS8 3
get_touch_device(TPS8, 3):set_control_state("slider001", "Green")
set_control_caption#
set_control_caption(name, caption)
Set the caption on a Touch control according to the parameters:
Parameter |
Value Type |
Description |
Value Example |
|---|---|---|---|
|
string |
The Key of the Touch Control. |
|
|
string |
The text to display as the control’s caption. |
|
For example:
-- Set button001's caption to "On" on TPS 2
get_touch_device(TPS, 2):set_control_caption("button001", "On")
set_interface_page#
set_interface_page(number[, transition])
Change the current page on the Touch interface according to the parameters:
Parameter |
Value Type |
Description |
Value Example |
|---|---|---|---|
|
integer |
Touch interface page to change to. |
|
|
integer |
Optional page transition. Integer value of constants: |
|
Note
Must be executed on the MTPC that hosts the interface.
For example:
-- Change the touch screen interface to page 4 with a snap transition on TPS5 3
get_touch_device(TPS5, 3):set_interface_page(4, SNAP)
set_interface_enabled#
set_interface_enabled([enabled])
Enable/disable the touchscreen, according to the optional boolean parameter enabled (default: true).
Note
Must be executed on the MTPC that hosts the interface.
For example:
-- Disable the touchscreen TPS8 4
get_touch_device(TPS8, 4):set_interface_enabled(false)
set_interface_locked#
set_interface_locked([lock])
Lock/unlock the touchscreen, according to the optional boolean parameter lock (default: true).
Note
Must be executed on the MTPC that hosts the interface.
For example:
-- Lock the touchscreen TPS 3
get_touch_device(TPS, 3):set_interface_locked()
-- Unlock the touchscreen TPS5 4
get_touch_device(TPS5, 4):set_interface_locked(false)