Skip to main content

KSPSwitch

The KSPSwitch class allows you to connect to a ui_switch in KSP.

import { KSPSwitch } from kontakt

var switch = KSPSwitch(id: "my_switch")

Constructors

constructor(id: String)

Connects to a ui_switch in KSP with the given control ID.

Properties

automate: Bool (get/set)

Activate/Deactivate automation touch. Set this to true when interacting with a control to write automation. Set it back to false once the user interaction is finished.

checked: Bool (get/set)

Whether the switch is checked.

connected: Bool (get)

Whether the control is connected. A control might not be connected if no corresponding control was found for the given id.

custom_id: Int (get)

The value of $CONTROL_PAR_CUSTOM_ID set on this control.

id: String (get)

The KSP control ID used this switch is connected to.

label: String (get)

The value of $CONTROL_PAR_LABEL set on this control.

Methods

toggle() -> ()

Toggles the checked state of the switch.