mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Updated LUA Keybinds (markdown)
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.
|
Creates a keybind using the given variables.
|
||||||
#### Syntax:
|
#### Syntax:
|
||||||
```lua
|
```lua
|
||||||
SetKeybind(string name, string hotkey, PressType pressType function function, [params]);
|
SetKeybind(string name, string hotkey, PressType pressType function function, [params])
|
||||||
```
|
```
|
||||||
##### Required arguments
|
##### Required arguments
|
||||||
- **name:** A name to identify the keybind by
|
- **name:** A name to identify the keybind by
|
||||||
@ -25,21 +25,21 @@ SetKeybind(string name, string hotkey, PressType pressType function function, [p
|
|||||||
```lua
|
```lua
|
||||||
-- Simply call a method
|
-- Simply call a method
|
||||||
function kbTest()
|
function kbTest()
|
||||||
print("oohai!");
|
print("oohai!")
|
||||||
end
|
end
|
||||||
Keybind.SetKeybind("test1", "SHIFT+D", kbTest);
|
Keybind.SetKeybind("test1", "SHIFT+D", kbTest)
|
||||||
|
|
||||||
-- Call a method with argument(s)
|
-- Call a method with argument(s)
|
||||||
function kbTest2(message)
|
function kbTest2(message)
|
||||||
print(message);
|
print(message)
|
||||||
end
|
end
|
||||||
Keybind.SetKeybind("test2", "SHIFT+F", kbTest2, "hello!!!");
|
Keybind.SetKeybind("test2", "SHIFT+F", kbTest2, "hello!!!")
|
||||||
```
|
```
|
||||||
---
|
---
|
||||||
### RemoveKeybind
|
### RemoveKeybind
|
||||||
Removes an existing keybind.
|
Removes an existing keybind.
|
||||||
```lua
|
```lua
|
||||||
RemoveKeybind(string name);
|
RemoveKeybind(string name)
|
||||||
```
|
```
|
||||||
##### Required arguments
|
##### Required arguments
|
||||||
- **name:** The name of the keybind to remove
|
- **name:** The name of the keybind to remove
|
||||||
@ -48,8 +48,8 @@ RemoveKeybind(string name);
|
|||||||
```lua
|
```lua
|
||||||
function kbTest()
|
function kbTest()
|
||||||
-- As a test, remove the keybind after being pressed once
|
-- As a test, remove the keybind after being pressed once
|
||||||
Keybind.RemoveKeybind("test");
|
Keybind.RemoveKeybind("test")
|
||||||
end
|
end
|
||||||
Keybind.SetKeybind("test", "SHIFT+F", kbTest);
|
Keybind.SetKeybind("test", "SHIFT+F", kbTest)
|
||||||
```
|
```
|
||||||
---
|
---
|
||||||
Loading…
x
Reference in New Issue
Block a user