mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
update doc/*/scripting/user-input.md
This commit is contained in:
parent
cb5d191d2f
commit
ef2c0b2370
2 changed files with 18 additions and 0 deletions
|
|
@ -40,12 +40,21 @@ input.add_callback(bindname: str, callback: function)
|
|||
```
|
||||
|
||||
Назначает функцию, которая будет вызываться при активации привязки. Пример:
|
||||
|
||||
```lua
|
||||
input.add_callback("hud.inventory", function ()
|
||||
print("Inventory open key pressed")
|
||||
end)
|
||||
```
|
||||
|
||||
Можно назначить функцию на нажатие клавиши.
|
||||
|
||||
```lua
|
||||
input.add_callback("key:space", function ()
|
||||
print("Space pressed")
|
||||
end)
|
||||
```
|
||||
|
||||
```python
|
||||
input.get_mouse_pos() -> {int, int}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue