add new input.* functions to docs

This commit is contained in:
MihailRis 2024-07-16 17:52:18 +03:00
parent ef22b2d7e0
commit c9958c9718
2 changed files with 36 additions and 0 deletions

View File

@ -59,3 +59,18 @@ input.get_bindings() -> strings array
```
Returns all binding names.
```python
input.is_pressed(code: str) -> bool
```
Checks input activity using a code consisting of:
- input type: *key* or *mouse*
- input code: [key name](#key names) or mouse button name (left, middle, right)
Example:
```lua
if (input.is_pressed("key:enter") {
...
}
```

View File

@ -57,3 +57,24 @@ input.get_bindings() -> массив строк
```
Возвращает названия всех доступных привязок.
```python
input.is_active(bindname: str) -> bool
```
Проверяет активность привязки.
```python
input.is_pressed(code: str) -> bool
```
Проверяет активность ввода по коду, состоящему из:
- типа ввода: key (клавиша) или mouse (кнопка мыши)
- код ввода: [имя клавиши](#имена-клавиш) или имя кнопки мыши (left, middle, right)
Пример:
```lua
if (input.is_pressed("key:enter") {
...
}
```