mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
add doc/*/scripting/builtins/libinput.md
This commit is contained in:
parent
bcfdb6196a
commit
64c73f4d0d
2 changed files with 20 additions and 2 deletions
|
|
@ -13,7 +13,16 @@ input.mousecode(mousename: str) --> int
|
|||
Returns mouse button code or -1 if unknown
|
||||
|
||||
```lua
|
||||
input.add_callback(bindname: str, callback: function)
|
||||
input.add_callback(
|
||||
-- Binding name
|
||||
bindname: str,
|
||||
-- Handler
|
||||
callback: function
|
||||
-- UI element that owns the handler (responsible for the handler's lifetime)
|
||||
[optional] owner: Element,
|
||||
-- Ignore input capture by UI elements
|
||||
[optional] istoplevel: bool
|
||||
)
|
||||
```
|
||||
|
||||
Add binding activation callback. Example:
|
||||
|
|
|
|||
|
|
@ -13,7 +13,16 @@ input.mousecode(mousename: str) --> int
|
|||
Возвращает код кнопки мыши по имени, либо -1
|
||||
|
||||
```lua
|
||||
input.add_callback(bindname: str, callback: function)
|
||||
input.add_callback(
|
||||
-- Имя привязки
|
||||
bindname: str,
|
||||
-- Обработчик
|
||||
callback: function
|
||||
-- UI элемент-владелец обработчика (отвечает за срок жизни)
|
||||
[опционально] owner: Element,
|
||||
-- Игнорировать захват ввода UI элементами
|
||||
[опционально] istoplevel: bool
|
||||
)
|
||||
```
|
||||
|
||||
Назначает функцию, которая будет вызываться при активации привязки. Пример:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue