Compare commits

...

6 Commits

Author SHA1 Message Date
Ken Van Hoeylandt
8e79cfec03 Revert gap change 2026-08-11 22:51:16 +02:00
Ken Van Hoeylandt
b53c558335 Scrollable improvements 2026-08-11 22:33:41 +02:00
Ken Van Hoeylandt
9373004c44 Gap set to 52 just works 2026-08-11 22:09:04 +02:00
Ken Van Hoeylandt
e76fc4c702 Fix keyboard 2026-08-11 22:08:59 +02:00
Ken Van Hoeylandt
1d0aea255c Fix for trackball 2026-08-11 21:48:15 +02:00
Ken Van Hoeylandt
c9452b8aeb Paths updated/fixed 2026-08-11 21:08:33 +02:00
7 changed files with 30 additions and 3 deletions

View File

@ -72,6 +72,9 @@
## Lower Priority
- lvgl-module has a keyboard.cpp that creates a `keyboard_group`. This group is set as the default group, so it can also work with trackball(= LVGL "encoder").
Make a separate group that is the default group. The keyboard can then use it (or use its own).
The basic idea is to invert the ownership: now the keyboard group is made the default group, but it's probably more logical to have the default group used by the keyboard.
- lvgl-module's spinner relies on hard-coded spinner asset from Tactility main project.
- Localize all apps
- Support hot-plugging SD card (note: this is not possible if they require the CS pin hack)

View File

@ -19,6 +19,10 @@ void lvgl_keyboard_on_start_lvgl() {
lvgl_lock();
keyboard_group = lv_group_create();
check(keyboard_group);
// We currently set this group as the default, so it doesn't only get (manually added) textareas,
// but gets all widgets by default. This is a temporary work-around until a proper default group is
// created to fix the trackball issue (see trackball.cpp and ideas.md, search for "group")
lv_group_set_default(keyboard_group);
lvgl_unlock();
}
@ -77,6 +81,8 @@ error_t lvgl_keyboard_add(struct Device* device, lv_display_t* display, lv_indev
lv_indev_set_display(indev, display);
}
lvgl_keyboard_enable(indev);
*out_indev = indev;
return ERROR_NONE;
}

View File

@ -1,6 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <lvgl/devices/trackball.h>
#include <lvgl/devices/device_context.h>
#include <lvgl/devices/keyboard.h>
#include <lvgl/lvgl.h>
#include <tactility/drivers/trackball.h>
@ -154,6 +155,13 @@ error_t lvgl_trackball_add(struct Device* device, lv_display_t* display, lv_inde
}
recenter_cursor(ctx, indev);
// Encoder indevs are useless without a group (LVGL dispatch bails out immediately if indev->group is NULL)
// Use the keyboard group for now, until it's refactored into a proper global/shared group. See ideas.md
// When refactoring this, you probably want to remove the calls to lvgl_keyboard_* below.
if (ctx->settings.mode == LVGL_TRACKBALL_MODE_ENCODER) {
lvgl_keyboard_enable(indev);
}
*out_indev = indev;
return ERROR_NONE;
}
@ -196,12 +204,14 @@ error_t lvgl_trackball_set_settings(lv_indev_t* indev, const struct LvglTrackbal
if (mode_changed) {
if (settings->mode == LVGL_TRACKBALL_MODE_POINTER) {
lvgl_keyboard_disable(indev);
lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER);
recenter_cursor(ctx, indev);
show_cursor(ctx, indev);
} else {
hide_cursor(ctx);
lv_indev_set_type(indev, LV_INDEV_TYPE_ENCODER);
lvgl_keyboard_enable(indev);
}
}

View File

@ -99,6 +99,7 @@ lv_obj_t* build_window_widget(lv_obj_t* content, WindowCreateWidgetsFn create_wi
lv_obj_set_style_pad_all(widget, 0, LV_STATE_DEFAULT);
lv_obj_set_style_border_width(widget, 0, LV_STATE_DEFAULT);
lv_obj_set_style_radius(widget, 0, LV_STATE_DEFAULT);
lv_obj_remove_flag(widget, LV_OBJ_FLAG_SCROLLABLE);
if (create_widgets != nullptr) {
create_widgets(widget, user_data);
}
@ -197,6 +198,8 @@ error_t window_manager_start(void) {
lv_obj_set_style_pad_all(real_widget, 0, LV_STATE_DEFAULT);
lv_obj_set_style_border_width(real_widget, 0, LV_STATE_DEFAULT);
lv_obj_set_style_radius(real_widget, 0, LV_STATE_DEFAULT);
// See build_window_widget()'s identical call for why.
lv_obj_remove_flag(real_widget, LV_OBJ_FLAG_SCROLLABLE);
content_widget = (screen_init != nullptr) ? screen_init(real_widget) : nullptr;
if (content_widget == nullptr) {

View File

@ -374,6 +374,7 @@ static lv_obj_t* windowManagerScreenInit(lv_obj_t* root) {
lv_obj_set_style_bg_color(vertical_container, lv_color_black(), LV_STATE_DEFAULT);
lv_obj_set_style_border_width(vertical_container, 0, LV_STATE_DEFAULT);
lv_obj_set_style_radius(vertical_container, 0, LV_STATE_DEFAULT);
lv_obj_remove_flag(vertical_container, LV_OBJ_FLAG_SCROLLABLE);
lvgl::statusbar_create(vertical_container);
@ -383,6 +384,7 @@ static lv_obj_t* windowManagerScreenInit(lv_obj_t* root) {
lv_obj_set_width(app_container, LV_PCT(100));
lv_obj_set_flex_grow(app_container, 1);
lv_obj_set_flex_flow(app_container, LV_FLEX_FLOW_COLUMN);
lv_obj_remove_flag(app_container, LV_OBJ_FLAG_SCROLLABLE);
// Parented to root (not app_container/vertical_container) so it overlays on top of
// everything, including the statusbar, regardless of which app is showing. Hidden until a

View File

@ -8,7 +8,7 @@
#include <cstdio>
#include <cstring>
static error_t get_user_data_root_path(char* out_path, size_t out_path_size) {
static error_t paths_get_user_data_root_path(char* out_path, size_t out_path_size) {
#if defined(CONFIG_TT_USER_DATA_LOCATION_INTERNAL)
#ifdef ESP_PLATFORM
const char* mount_point = "/data";
@ -21,7 +21,7 @@ static error_t get_user_data_root_path(char* out_path, size_t out_path_size) {
std::strcpy(out_path, mount_point);
return ERROR_NONE;
#elif defined(CONFIG_TT_USER_DATA_LOCATION_SD)
struct FileSystem* found = nullptr;
FileSystem* found = nullptr;
file_system_for_each(&found, [](FileSystem* fs, void* context) {
auto* owner = file_system_get_owner(fs);
if (owner == nullptr || device_get_type(owner) != &SDCARD_TYPE) {
@ -44,7 +44,7 @@ extern "C" {
error_t paths_get_user_data_path(char* out_path, size_t out_path_size) {
#ifdef ESP_PLATFORM
char root[64];
error_t error = get_user_data_root_path(root, sizeof(root));
error_t error = paths_get_user_data_root_path(root, sizeof(root));
if (error != ERROR_NONE) {
return error;
}

View File

@ -42,6 +42,7 @@
#include <tactility/filesystem/file_system.h>
#include <tactility/memory.h>
#include <tactility/module.h>
#include <tactility/paths.h>
#include <tactility/preferences.h>
#include <tactility/properties_file.h>
#include <tactility/wifi_auto_scan.h>
@ -243,6 +244,8 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = {
// drivers/keyboard
DEFINE_MODULE_SYMBOL(keyboard_read_key),
DEFINE_MODULE_SYMBOL(KEYBOARD_TYPE),
// drivers/paths
DEFINE_MODULE_SYMBOL(paths_get_user_data_path),
// drivers/pointer
DEFINE_MODULE_SYMBOL(pointer_enter_sleep),
DEFINE_MODULE_SYMBOL(pointer_exit_sleep),