Input examples
The engine's input examples: what each one shows, whether it runs in a browser and the command that runs it.
Keyboard, mouse, gamepads, touch, text input and IME. There are 12 examples on this page. For the concepts behind them, see Input.
Run any of them from the engine core's workspace (the folder of the engine source that holds the neo crate's Cargo.toml); see Run an example.
Examples#
| Example | What it shows | Web | Run |
|---|---|---|---|
| Char Input Events | Prints out all chars as they are inputted | No | cargo run --example char_input_events |
| Gamepad Input | Shows handling of gamepad input, connections, and disconnections | No | cargo run --example gamepad_input |
| Gamepad Input Events | Iterates and prints gamepad input and connection events | No | cargo run --example gamepad_input_events |
| Gamepad Rumble | Shows how to rumble a gamepad using force feedback | No | cargo run --example gamepad_rumble |
| Keyboard Input | Demonstrates handling a key press/release | No | cargo run --example keyboard_input |
| Keyboard Input Events | Prints out all keyboard events | No | cargo run --example keyboard_input_events |
| Keyboard Modifiers | Demonstrates using key modifiers (ctrl, shift) | No | cargo run --example keyboard_modifiers |
| Mouse Grab | Demonstrates how to grab the mouse, locking the cursor to the app's screen | No | cargo run --example mouse_grab |
| Mouse Input | Demonstrates handling a mouse button press/release | No | cargo run --example mouse_input |
| Mouse Input Events | Prints out all mouse events (buttons, movement, etc.) | No | cargo run --example mouse_input_events |
| Touch Input | Displays touch presses, releases, and cancels | No | cargo run --example touch_input |
| Touch Input Events | Prints out all touch inputs | No | cargo run --example touch_input_events |