1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Updated LUA Keybinds (markdown)

Robert Beekman 2017-09-12 14:20:21 +02:00
parent 98aae707e1
commit dc9c4e4add

@ -9,7 +9,7 @@ The Keybind module allows you to execute pieces of script when a certain key or
Creates a keybind using the given variables.
#### Syntax:
```lua
SetKeybind(string name, string hotkey, PressType pressType function function, [params]);
SetKeybind(string name, string hotkey, PressType pressType function function, [params])
```
##### Required arguments
- **name:** A name to identify the keybind by
@ -25,21 +25,21 @@ SetKeybind(string name, string hotkey, PressType pressType function function, [p
```lua
-- Simply call a method
function kbTest()
print("oohai!");
print("oohai!")
end
Keybind.SetKeybind("test1", "SHIFT+D", kbTest);
Keybind.SetKeybind("test1", "SHIFT+D", kbTest)
-- Call a method with argument(s)
function kbTest2(message)
print(message);
print(message)
end
Keybind.SetKeybind("test2", "SHIFT+F", kbTest2, "hello!!!");
Keybind.SetKeybind("test2", "SHIFT+F", kbTest2, "hello!!!")
```
---
### RemoveKeybind
Removes an existing keybind.
```lua
RemoveKeybind(string name);
RemoveKeybind(string name)
```
##### Required arguments
- **name:** The name of the keybind to remove
@ -48,8 +48,8 @@ RemoveKeybind(string name);
```lua
function kbTest()
-- As a test, remove the keybind after being pressed once
Keybind.RemoveKeybind("test");
Keybind.RemoveKeybind("test")
end
Keybind.SetKeybind("test", "SHIFT+F", kbTest);
Keybind.SetKeybind("test", "SHIFT+F", kbTest)
```
---