|
deki-input 0.19.0
Deki package reference
|
Input handling and collision detection
Repository: github.com/dekiengine/deki-input · Latest release: 0.19.0 · Needs engine 0.19.0+ · Requires: deki-rendering
Install with DekiEditor --packages-add deki-input <project>, or from the Package Manager. The engine's own components and C++ API are in the Deki docs.
Shown in the editor as Input.
| Component | Category | Description |
|---|---|---|
| I2CKeyboardComponent | Input | Reads a keyboard that hands over one typed character per I2C read: the LilyGO T-Deck's, the M5Stack CardKB. |
| InputCollider | Input | Hit area for pointer and touch. Buttons and scrolls listen to it. |
| TrackballComponent | Input | A trackball on GPIO pins, as arrow keys and Enter or as a pointer. |
Parts you can leave out of a build. A feature with a define is switched there; the rest are stripped with their components.
| Feature | Define | Default |
|---|---|---|
| Colliders | DEKI_FEATURE_INPUT | on |
| I2C Keyboard | DEKI_FEATURE_INPUT_I2C_KEYBOARD | on |
| Trackball | DEKI_FEATURE_INPUT_TRACKBALL | on |
Reads a keyboard that hands over one typed character per I2C read: the LilyGO T-Deck's, the M5Stack CardKB.
Inspector name: I2C Keyboard · Category: Input · Type: DekiInput::I2CKeyboardComponent
| Property | Type | Default | Constraints | Description |
|---|---|---|---|---|
| i2cPort | int32 | 0 | 0 to 3 | Which I2C bus the keyboard is on. Must match the I2C Bus component that set that port up. |
| i2cAddress | int32 | 85 | 0 to 127 | The keyboard's address on the bus: 0x55 (85) for the LilyGO T-Deck, 0x5F (95) for the M5Stack CardKB. |
| hasBacklight | bool | false | The keyboard has a backlight it controls itself, set over the bus (the LilyGO T-Deck's: brightness in register 0x01). Game code then sets it with I2CKeyboard::SetBacklight. |
Hit area for pointer and touch. Buttons and scrolls listen to it.
Inspector name: Input Collider · Category: Input · Type: DekiInput::InputCollider
| Property | Type | Default | Constraints | Description |
|---|---|---|---|---|
| width | float | 0 | in m | Width of the hit area in meters. It does not have to match what is drawn. |
| height | float | 0 | in m | Height of the hit area in meters. |
| paddingLeft | float | 0 | in m | Extra hit area beyond the left edge, in meters. Useful for making a small control comfortable to hit with a finger without making it look bigger. |
| paddingRight | float | 0 | in m | Extra hit area beyond the right edge, in meters. |
| paddingTop | float | 0 | in m | Extra hit area above the top edge, in meters. |
| paddingBottom | float | 0 | in m | Extra hit area below the bottom edge, in meters. |
| consumeInput | bool | true | Stop the press here instead of letting it reach objects underneath. Turn it off for an overlay that should not block what is behind it. |
A trackball on GPIO pins, as arrow keys and Enter or as a pointer.
Inspector name: Trackball · Category: Input · Type: DekiInput::TrackballComponent
| Property | Type | Default | Constraints | Description |
|---|---|---|---|---|
| mode | enum | "Keys" | Keys, Pointer | Keys: rolling presses the arrow keys and the click is Enter. Pointer: rolling moves a pointer and the click is a mouse button. |
| pixelsPerStep | int32 | 4 | 1 to 64 | Pointer mode: how many pixels one step of the ball moves the pointer |
| glideMs | float | 0 | 0 to 1000 | Pointer mode: how long the pointer keeps gliding after the ball stops, in milliseconds, like a ThinkPad TrackPoint. 0 moves it exactly by the steps rolled. |
| acceleration | float | 1 | 1 to 8 | Pointer mode with a glide: how many times further each step carries the pointer when the ball is spun fast than when it is rolled slowly. 1: no acceleration. |
| upPin | int32 | -1 | -1 to 48 | The line that pulses when the ball rolls up |
| downPin | int32 | -1 | -1 to 48 | The line that pulses when the ball rolls down |
| leftPin | int32 | -1 | -1 to 48 | The line that pulses when the ball rolls left |
| rightPin | int32 | -1 | -1 to 48 | The line that pulses when the ball rolls right |
| clickPin | int32 | -1 | -1 to 48 | The click switch (-1 = none) |
| clickActiveLow | bool | true | The click pulls its pin low when pressed (on), or high (off) |
Earlier releases: CHANGELOG.md.
Generated from the package's reflection data (engine 0.19.0). Property names are the keys used in scene files. Renames keep an alias (compatibility).