From 18a1fbeac9ee2860a2bd3a0925fe0cf5e75867b1 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Tue, 1 Nov 2016 17:44:57 +0100 Subject: [PATCH] Created Keyboard (markdown) --- Keyboard.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Keyboard.md diff --git a/Keyboard.md b/Keyboard.md new file mode 100644 index 0000000..381c762 --- /dev/null +++ b/Keyboard.md @@ -0,0 +1,52 @@ +The Keyboard variable lets you interact with the currently active keyboard. + +## Properties +### Name +Returns the name of the keyboard. + +#### Example: +```lua +print("Current keyboard: ".. Keyboard.Name); +``` + +#### Result: +``` +Current keyboard: K95 RGB +``` + +## Functions +### GetLayers +Returns all layers within the profile +#### Syntax: +```lua +table GetLayers( ); +``` +#### Example: +```lua +local layers = Profile.GetLayers(); +for layerKey, layerValue in pairs(layers) do + print(layerValue.Name) +end +``` +#### Result: +``` +Test layer 1 +Test layer 2 +``` + +### GetLayerByName +If found, returns the first layer with the given name +#### Syntax: +```lua +layer GetLayerByName(string layerName); +``` +#### Example: +```lua +local layer = Profile.GetLayerByName("Test layer 1"); +print(layer.Name) +end +``` +#### Result: +``` +Test layer 1 +``` \ No newline at end of file