Kontakt Ui¶
Kontakt UI Utilities
Import¶
import "_IVLS/std-library/nodes/components/kontakt-ui.ksp"Node: Stl.KontaktUI¶
Uses: Init, TimerMsTick
Overview¶
Kontakt UI Utilities
Shared UI constants, layout helpers, and modifier-key utilities for IVLS products.
LIBRARY: Stl.KontaktUI
Provides:
- Layout constants for product area dimensions and header/footer heights
- A param-display label with auto-clear timer
- Modifier-key bitmask helpers for use in UI callbacks
- Double-click detection via ENGINE_UPTIME comparison
- Shorthand table property for indexed control access
- Condition macros for modifier and signal-type checks
API¶
Nodes¶
| Name | Description |
|---|---|
node Stl.KontaktUI |
Core Kontakt UI node. |
Defines¶
| Name | Description |
|---|---|
define CONDITION.ANY_MODIFIER(#control#) |
Evaluates to TRUE if any of Alt, Shift, or Ctrl is held on the given control. |
define CONDITION.IS_SIGNAL_TYPE(#type#) |
Evaluates to TRUE if the current NI_SIGNAL_TYPE matches the given type constant. |
Const Blocks¶
| Name | Description |
|---|---|
const UI.PAR |
Integer index constants for use with ui.control_pars and set_control_par. (16 entries) |
Properties¶
| Name | Description |
|---|---|
property table |
Shorthand property for reading and writing indexed table control values by UI ID. |
Macros¶
| Name | Description |
|---|---|
ui.set_font_for_all_states(#ui_ctrl_or_id#, #font_id#) |
Sets all six font slots of a button, switch, or menu to the same font in one cal... |
Functions¶
| Name | Description |
|---|---|
ui.dbl_click_time() -> ms |
Returns the double-click threshold in milliseconds. |
ui.get_bottom_strip_start() -> y |
Returns the Y coordinate where the bottom strip area begins, accounting for whet... |
ui.get_modifier_bitmask(ui_ctrl) -> return |
Builds a bitmask from the Ctrl, Shift, and Alt states of the given UI control. |
ui.is_alt_pressed(bitmask) -> return |
Tests whether the Alt key is active in the given modifier bitmask. |
ui.is_ctrl_pressed(bitmask) -> return |
Tests whether the Control key is active in the given modifier bitmask. |
ui.is_dbl_click() -> return |
Detects a double-click by comparing ENGINE_UPTIME against the last click timesta... |
ui.is_shift_pressed(bitmask) -> return |
Tests whether the Shift key is active in the given modifier bitmask. |
ui.set_display(str) |
Sets the parameter display label text. |
ui.show_compile_info() |
Displays a compile-date/time string in the param display label. |
Nodes¶
node Stl.KontaktUI¶
Callbacks: Init, TimerMsTick
Core Kontakt UI node. Declares layout constants, a param-display label, modifier-key helpers, and a table shorthand property used across all IVLS products.
Defines¶
define CONDITION.ANY_MODIFIER(#control#)¶
Evaluates to TRUE if any of Alt, Shift, or Ctrl is held on the given control.
| Parameter | Description |
|---|---|
#control# |
the UI control whose modifier key properties are tested |
define CONDITION.IS_SIGNAL_TYPE(#type#)¶
Evaluates to TRUE if the current NI_SIGNAL_TYPE matches the given type constant.
| Parameter | Description |
|---|---|
#type# |
the NI signal type constant to compare against |
Const Blocks¶
const UI.PAR¶
Integer index constants for use with ui.control_pars and set_control_par. Each constant maps to the corresponding CONTROL_PAR_* built-in.
| Index | Name |
|---|---|
| 0 | X |
| 1 | Y |
| 2 | WIDTH |
| 3 | HEIGHT |
| 4 | DEFAULT |
| 5 | MOUSE_BEHAVIOR |
| 6 | FONT_TYPE |
| 7 | TEXTPOS_Y |
| 8 | TEXT_ALIGNMENT |
| 9 | SHOW_ARROWS |
| 10 | ALLOW_AUTOMATION |
| 11 | Z_LAYER |
| 12 | HIDE |
| 13 | PICTURE |
| 14 | HELP |
| 15 | AUTOMATION_NAME |
Properties¶
property table¶
Shorthand property for reading and writing indexed table control values by UI ID.
get(id, idx) -> resultset(id, idx, value)
Macros¶
ui.set_font_for_all_states(#ui_ctrl_or_id#, #font_id#)¶
Sets all six font slots of a button, switch, or menu to the same font in one call.
| Parameter | Description |
|---|---|
#ui_ctrl_or_id# |
name or ID of the UI control |
#font_id# |
internal font number (0 to 25); get_font_id() may also be used |
Functions¶
ui.dbl_click_time() -> ms¶
Returns the double-click threshold in milliseconds. Override per product to tune sensitivity.
Returns: ms — double-click detection window in milliseconds (default: 250)
ui.get_bottom_strip_start() -> y¶
Returns the Y coordinate where the bottom strip area begins, accounting for whether a display footer is present.
Returns: y — pixel Y offset of the bottom control strip
ui.get_modifier_bitmask(ui_ctrl) -> return¶
Builds a bitmask from the Ctrl, Shift, and Alt states of the given UI control.
| Parameter | Type | Description |
|---|---|---|
ui_ctrl |
integer | UI ID of the control (button, switch, slider, knob, table, waveform, XY pad, or mouse area) |
Returns: return — bitmask of active modifier keys; compare with UI.CTRL_KEY, UI.SHIFT_KEY, UI.ALT_KEY using .and.
ui.is_alt_pressed(bitmask) -> return¶
Tests whether the Alt key is active in the given modifier bitmask.
| Parameter | Type | Description |
|---|---|---|
bitmask |
integer | key modifier bitmask from ui.get_modifier_bitmask() |
Returns: return — TRUE if the Alt key bit is set
ui.is_ctrl_pressed(bitmask) -> return¶
Tests whether the Control key is active in the given modifier bitmask.
| Parameter | Type | Description |
|---|---|---|
bitmask |
integer | key modifier bitmask from ui.get_modifier_bitmask() |
Returns: return — TRUE if the Control key bit is set
ui.is_dbl_click() -> return¶
Detects a double-click by comparing ENGINE_UPTIME against the last click timestamp.
Returns: return — TRUE if the interval since the last click is within the double-click threshold
ui.is_shift_pressed(bitmask) -> return¶
Tests whether the Shift key is active in the given modifier bitmask.
| Parameter | Type | Description |
|---|---|---|
bitmask |
integer | key modifier bitmask from ui.get_modifier_bitmask() |
Returns: return — TRUE if the Shift key bit is set
ui.set_display(str)¶
Sets the parameter display label text. Has no effect when display is disabled.
| Parameter | Type | Description |
|---|---|---|
str |
string | text to show in the param display area |
ui.show_compile_info()¶
Displays a compile-date/time string in the param display label. Override per product if needed.
Example¶
// TODO: Add usage example