Skip to content

Commit

Permalink
docs: w should be required otherwise it cannot work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Mar 4, 2024
1 parent 23d04a9 commit e87d6e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/plugins/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Request user input:
- `1`: Required, the origin position of the input, which is a string accepts `"top-left"`, `"top-center"`, `"top-right"`, `"bottom-left"`, `"bottom-center"`, `"bottom-right"`, `"center"`, and `"hovered"`.
- `x`: Optional, the X offset from the origin position, which is an positive or negative integer.
- `y`: Optional, the Y offset from the origin position, which is an positive or negative integer.
- `w`: Optional, the width of the input, which is an positive integer.
- `w`: Required, the width of the input, which is an positive integer.
- `h`: Optional, the height of the input, which is an positive integer.
- `realtime`: Optional, whether to report user input in real time, which is a boolean.

Expand All @@ -102,14 +102,14 @@ local value, event = ya.input {

Returns `(value, event)`:

- `value` - The user input value carried by this event, which is a string if the event is non-zero; otherwise, `nil`.
- `value` - The user input value carried by this event, which is a string if the `event` is non-zero; otherwise, `nil`.
- `event` - The event type, which is an integer:
- 0: Unknown error.
- 1: The user has confirmed the input.
- 2: The user has canceled the input.
- 3: The user has changed the input (only if `realtime` is true).

When `realtime = true` set, `ya.input()` returns a receiver, which has a `recv()` method that can be called multiple times to receive events.
When `realtime = true` specified, `ya.input()` returns a receiver, which has a `recv()` method that can be called multiple times to receive events.

```lua
local input = ya.input {
Expand Down

0 comments on commit e87d6e0

Please sign in to comment.