KeyboardEventType Class |
Namespace: KSPDev.GUIUtils.TypeFormatters
The KeyboardEventType type exposes the following members.
Name | Description | |
---|---|---|
KeyboardEventType | Constructs an object from an event. |
Name | Description | |
---|---|---|
Format | Formats the value into a human friendly string. | |
ToString | Returns a string formatted as a human friendly key specification. (Overrides ObjectToString.) |
Name | Description | |
---|---|---|
(Event to KeyboardEventType) | Converts a numeric value into a type object. | |
(KeyboardEventType to Event) | Converts a type object into an event value. |
public class KeyboardEventTypeDemo1 : PartModule { static readonly Message<KeyboardEventType> msg1 = new Message<KeyboardEventType>( "#TypeDemo_msg1", defaultTemplate: "Keybinding is [<<1>>]"); // Depending on the current language in the system, this method will present different unit names. void Show() { Debug.Log(msg1.Format(Event.KeyboardEvent("^1"))); // Prints: Keybinding is [Ctrl+1] Debug.Log(msg1.Format(Event.KeyboardEvent("^[1]"))); // Prints: Keybinding is [Ctrl+Alpha1] Debug.Log(msg1.Format(Event.KeyboardEvent("$^A"))); // Prints: Keybinding is [Shift+Ctrl+A] } }