mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
new docs
This commit is contained in:
1 parent
3cebaf7fa5
commit
b5eba8423f
229 files changed
+6238
-10690
No files matched your search
@@ -0,0 +1,35 @@
|
||||
```lua
|
||||
lib.addKeybind(data)
|
||||
```
|
||||
|
||||
* data: `table`
|
||||
* name: `string`
|
||||
* description: `string`
|
||||
* defaultKey?: `string`
|
||||
* Default: None
|
||||
* currentKey: `string`
|
||||
* disabled?: `boolean`
|
||||
* disable?: `function`(self: `table`, toggle: `boolean`)
|
||||
* onPressed?: `function`(self: `table`)
|
||||
* onReleased?: `function`(self: `table`)
|
||||
|
||||
```lua
|
||||
local keybind = lib.addKeybind({
|
||||
name = 'respects',
|
||||
description = 'press F to pay respects',
|
||||
defaultKey = 'F',
|
||||
onPressed = function(self)
|
||||
print(('pressed %s (%s)'):format(self.currentKey, self.name))
|
||||
end,
|
||||
onReleased = function(self)
|
||||
print(('released %s (%s)'):format(self.currentKey, self.name))
|
||||
end,
|
||||
})
|
||||
```
|
||||
|
||||
Keybinds can be enabled/disabled by using the disable method.
|
||||
|
||||
```lua
|
||||
keybind:disable(true) -- disable
|
||||
keybind:disable(false) -- enable
|
||||
```
|
||||
Reference in new issue
Block a user