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