mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
update doc/*/scripting/user-input.md
This commit is contained in:
parent
df9c301f58
commit
0d17396fe8
2 changed files with 20 additions and 0 deletions
|
|
@ -55,6 +55,16 @@ input.add_callback("key:space", function ()
|
|||
end)
|
||||
```
|
||||
|
||||
Также можно привязать время жизни функции к UI контейнеру, вместо HUD.
|
||||
В таком случае, `input.add_callback` можно использовать до вызова `on_hud_open`.
|
||||
|
||||
```lua
|
||||
input.add_callback("key:escape", function ()
|
||||
print("NO")
|
||||
return true -- предотвращает вызов назначенных ранее функций
|
||||
end, document.root)
|
||||
```
|
||||
|
||||
```python
|
||||
input.get_mouse_pos() -> {int, int}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue