This fork uses bevy_input_focus to only pass keyboard input to the currently focused text input. At the moment the only builtin way to focus a text input is clicking on it but you can also spawn the entity with the AutoFocus component, set the FocusedInput resource or use the tab_navigation / directional_navigation modules from bevy_input_focus.
Im still concidering if it makes sense to integrate move of these directly into simple_text_input.
An unambitious single-line text input widget for bevy_ui.
Important
Code and examples in the main branch are under development and may not be compatible with the released version on crates.io. The latest branch will contain the code from the most recent release.
See examples/basic.rs.
I am not trying to build and maintain an enterprise-grade text input, just something that is good enough to be useful in small projects.
- Scrolling
- Keyboard cursor movement (char, word, start/end)
- Disable / focus
- Placeholders
- Doesn't completely choke on unicode
- Password masking
- "Submit" events
- Input filtering
- Length limit
- Mouse cursor movement
- Proper unicode grapheme support
- IME support
I might consider very high quality contributions in these areas, but probably won't be working on them myself. These would likely involve adding dependencies or adding lots of code that I don't want to commit to maintaining.
- Multi-line
- Copy / paste
- Selection
- Mobile
- Rich text
bevy_simple_text_input | bevy |
|---|---|
0.11 | 0.16 |
0.10 | 0.15 |
0.8-0.9 | 0.14 |
0.4-0.7 | 0.13 |
0.3 | 0.12 |
0.1-0.2 | 0.11 |
Please feel free to open a PR!
The code should be simple enough for users to quickly understand and modify for their own purposes. Any new dependencies must not also depend on Bevy. Ideally, we should not add any new dependencies.
Please keep PRs small and scoped to a single feature or fix.
If you need more features, check out bevy_ui_text_input or bevy_egui.
