hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
71 lines (33 loc) • 969 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [client](./client.md) > [HytopiaUI](./client.hytopiaui.md) > [pressInput](./client.hytopiaui.pressinput.md)
## HytopiaUI.pressInput() method
Simulates player input programmatically. Useful for creating custom UI controls that trigger game actions, such as for mobile UI buttons.
**Signature:**
```typescript
pressInput(input: string, pressed: boolean): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
input
</td><td>
string
</td><td>
Input name (e.g., 'forward', 'backward', 'left', 'right', 'jump', 'sprint')
</td></tr>
<tr><td>
pressed
</td><td>
boolean
</td><td>
`true` to press and hold the input, `false` to release it
</td></tr>
</tbody></table>
**Returns:**
void