12345678910111213141516171819202122232425262728293031 |
- #ifndef TEXT_INPUT_H
- #define TEXT_INPUT_H
- #include "utils/List.h"
- class TextInput final {
- List<unsigned int> input;
- int cursor;
- int limit;
- bool active;
- public:
- TextInput();
- void setLimit(int limit);
- void reset();
- void setActive(bool b);
- void onKeyEvent(int key, int scancode, int action, int mods);
- void onCharEvent(unsigned int codepoint);
- template<int N>
- void toString(StringBuffer<N>& s) const {
- for(unsigned int c : input) {
- s.appendUnicode(c);
- }
- }
- int getCursor() const;
- };
- #endif
|