refactor input.h and related

This commit is contained in:
A-lex-Ra
2024-02-23 18:49:15 +06:00
parent 9c31c6c8b7
commit 8bb1045e34
12 changed files with 236 additions and 254 deletions
+5 -7
View File
@@ -441,7 +441,7 @@ void TextBox::mouseMove(GUI*, int x, int y) {
extendSelection(index);
}
void TextBox::keyPressed(int key) {
void TextBox::keyPressed(keycode key) {
bool shiftPressed = Events::pressed(keycode::LEFT_SHIFT);
uint previousCaret = caret;
if (key == keycode::BACKSPACE) {
@@ -624,16 +624,14 @@ void InputBindBox::drawBackground(const GfxContext* pctx, Assets* assets) {
label->setText(util::str2wstr_utf8(binding.text()));
}
void InputBindBox::clicked(GUI*, int button) {
binding.type = inputtype::mouse;
binding.code = button;
void InputBindBox::clicked(GUI*, mousecode button) {
binding.reset(button);
defocus();
}
void InputBindBox::keyPressed(int key) {
void InputBindBox::keyPressed(keycode key) {
if (key != keycode::ESCAPE) {
binding.type = inputtype::keyboard;
binding.code = key;
binding.reset(key);
}
defocus();
}