pushEvent insteado of putEvent

This commit is contained in:
Bertrand Songis
2021-03-12 11:07:30 +01:00
parent d8497a8bbc
commit 773e635bbd
2 changed files with 10 additions and 10 deletions
+7 -7
View File
@@ -30,43 +30,43 @@ NumberKeyboard::NumberKeyboard() :
{
new TextButton(this, {LCD_W / 2 - 115, 10, 50, 30}, "<<",
[=]() -> uint8_t {
putEvent(EVT_VIRTUAL_KEY_BACKWARD);
pushEvent(EVT_VIRTUAL_KEY_BACKWARD);
return 0;
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
new TextButton(this, {LCD_W / 2 - 55, 10, 50, 30}, "-",
[=]() -> uint8_t {
putEvent(EVT_VIRTUAL_KEY_MINUS);
pushEvent(EVT_VIRTUAL_KEY_MINUS);
return 0;
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
new TextButton(this, {LCD_W / 2 + 5, 10, 50, 30}, "+",
[=]() -> uint8_t {
putEvent(EVT_VIRTUAL_KEY_PLUS);
pushEvent(EVT_VIRTUAL_KEY_PLUS);
return 0;
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
new TextButton(this, {LCD_W / 2 + 65, 10, 50, 30}, ">>",
[=]() -> uint8_t {
putEvent(EVT_VIRTUAL_KEY_FORWARD);
pushEvent(EVT_VIRTUAL_KEY_FORWARD);
return 0;
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
new TextButton(this, {LCD_W / 2 - 115, 50, 50, 30}, "MIN",
[=]() -> uint8_t {
putEvent(EVT_VIRTUAL_KEY_MIN);
pushEvent(EVT_VIRTUAL_KEY_MIN);
return 0;
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
new TextButton(this, {LCD_W / 2 + 65, 50, 50, 30}, "MAX",
[=]() -> uint8_t {
putEvent(EVT_VIRTUAL_KEY_MAX);
pushEvent(EVT_VIRTUAL_KEY_MAX);
return 0;
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
new TextButton(this, {LCD_W / 2 - 55, 50, 110, 30}, "DEFAULT",
[=]() -> uint8_t {
putEvent(EVT_VIRTUAL_KEY_DEFAULT);
pushEvent(EVT_VIRTUAL_KEY_DEFAULT);
return 0;
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
}
+3 -3
View File
@@ -146,7 +146,7 @@ bool TextKeyboard::onTouchEnd(coord_t x, coord_t y)
}
else if (*key == KEYBOARD_SPACE[0]) {
if (x <= 135) {
putEvent(EVT_VIRTUAL_KEY(' '));
pushEvent(EVT_VIRTUAL_KEY(' '));
return true;
}
x -= 135;
@@ -164,7 +164,7 @@ bool TextKeyboard::onTouchEnd(coord_t x, coord_t y)
uint8_t specialKey = *key;
if (specialKey == 128) {
// backspace
putEvent(EVT_VIRTUAL_KEY(KEYBOARD_BACKSPACE[0]));
pushEvent(EVT_VIRTUAL_KEY(KEYBOARD_BACKSPACE[0]));
}
else {
layout = KEYBOARD_LAYOUTS[specialKey - 129];
@@ -176,7 +176,7 @@ bool TextKeyboard::onTouchEnd(coord_t x, coord_t y)
}
else {
if (x <= 30) {
putEvent(EVT_VIRTUAL_KEY(*key));
pushEvent(EVT_VIRTUAL_KEY(*key));
return true;
}
x -= 30;