Always include code for visual keyboards
Used now on non-touch interfaces as well.
This commit is contained in:
committed by
Raphael Coeffic
parent
390fed8997
commit
e47b1ca245
+3
-13
@@ -6,10 +6,6 @@ if(HARWARE_TOUCH)
|
||||
add_definitions(-DHARDWARE_TOUCH)
|
||||
endif()
|
||||
|
||||
if(SOFTWARE_KEYBOARD)
|
||||
add_definitions(-DSOFTWARE_KEYBOARD)
|
||||
endif()
|
||||
|
||||
set(LIBOPENUI_SRC
|
||||
libopenui_file.cpp
|
||||
bitmapbuffer.cpp
|
||||
@@ -35,21 +31,15 @@ set(LIBOPENUI_SRC
|
||||
table.cpp
|
||||
modal_window.cpp
|
||||
dialog.cpp
|
||||
keyboard_text.cpp
|
||||
keyboard_number.cpp
|
||||
keyboard_base.cpp
|
||||
# LVGL widgets
|
||||
widgets/window_base.c
|
||||
widgets/simple_btn.c
|
||||
widgets/field_edit.c
|
||||
)
|
||||
|
||||
if(SOFTWARE_KEYBOARD)
|
||||
set(LIBOPENUI_SRC
|
||||
${LIBOPENUI_SRC}
|
||||
keyboard_text.cpp
|
||||
keyboard_number.cpp
|
||||
keyboard_base.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
foreach(LIBOPENUI_FILE ${LIBOPENUI_SRC})
|
||||
set(LIBOPENUI_SRC_FILES ${LIBOPENUI_SRC_FILES} ${LIBOPENUI_SRC_DIR}/src/${LIBOPENUI_FILE})
|
||||
endforeach()
|
||||
|
||||
+3
-8
@@ -19,11 +19,7 @@
|
||||
|
||||
#include "numberedit.h"
|
||||
#include "widgets/field_edit.h"
|
||||
|
||||
#if defined(SOFTWARE_KEYBOARD)
|
||||
#include "keyboard_number.h"
|
||||
#endif
|
||||
|
||||
|
||||
static void numberedit_cb(lv_event_t* e)
|
||||
{
|
||||
@@ -99,7 +95,6 @@ void NumberEdit::onEvent(event_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
case EVT_VIRTUAL_KEY_PLUS:
|
||||
setValue(getValue() + getStep());
|
||||
break;
|
||||
@@ -131,7 +126,6 @@ void NumberEdit::onEvent(event_t event)
|
||||
case EVT_VIRTUAL_KEY_SIGN:
|
||||
setValue(-getValue());
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +137,8 @@ void NumberEdit::onClicked()
|
||||
lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
|
||||
if(indev_type == LV_INDEV_TYPE_POINTER) {
|
||||
NumberKeyboard::show(this);
|
||||
} else {
|
||||
FormField::onClicked();
|
||||
return;
|
||||
}
|
||||
|
||||
FormField::onClicked();
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
|
||||
#include "widgets/field_edit.h"
|
||||
|
||||
// #include "libopenui_config.h"
|
||||
|
||||
#if !defined(STR_EDIT)
|
||||
#define STR_EDIT "Edit"
|
||||
#endif
|
||||
@@ -32,9 +30,7 @@
|
||||
#define STR_CLEAR "Clear"
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
#include "keyboard_text.h"
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_KEYS)
|
||||
#include "menu.h"
|
||||
@@ -93,14 +89,12 @@ void TextEdit::onEvent(event_t event)
|
||||
{
|
||||
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString().c_str(), event);
|
||||
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
if (IS_VIRTUAL_KEY_EVENT(event)) {
|
||||
uint8_t c = event & 0xFF;
|
||||
if (c == (uint8_t)KEYBOARD_ENTER[0]) {
|
||||
changeEnd();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_KEYS)
|
||||
if (editMode) {
|
||||
|
||||
Reference in New Issue
Block a user