Skip to content

Commit 8a12020

Browse files
committed
examples/lvgldemo: optional second pointer device
The NuttX LVGL port can read two pointer devices into the same UI, and the demo now exposes that: the physical touchscreen stays on the primary path and EXAMPLES_LVGLDEMO_UTOUCH_DEVPATH names the second one typically a VNC server's remote pointer. Pointing the single input at the remote device had traded the panel's touch away for it. Assisted-by: Claude:opus-5 Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
1 parent e885cce commit 8a12020

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

examples/lvgldemo/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ config EXAMPLES_LVGLDEMO_STACKSIZE
2020
int "lvgldemo stack size"
2121
default 16384
2222

23+
config EXAMPLES_LVGLDEMO_UTOUCH_DEVPATH
24+
string "Second pointer device path"
25+
depends on INPUT_TOUCHSCREEN
26+
---help---
27+
Optional second pointer device, opened alongside the primary
28+
touchscreen: both drive the same UI. A VNC server's remote
29+
pointer device is the usual tenant. Leave empty for none.
30+
2331
config EXAMPLES_LVGLDEMO_INPUT_DEVPATH
2432
string "Touchscreen device path"
2533
default "/dev/input0"

examples/lvgldemo/lvgldemo.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@ int main(int argc, FAR char *argv[])
115115

116116
#ifdef CONFIG_INPUT_TOUCHSCREEN
117117
info.input_path = CONFIG_EXAMPLES_LVGLDEMO_INPUT_DEVPATH;
118+
#ifdef CONFIG_EXAMPLES_LVGLDEMO_UTOUCH_DEVPATH
119+
/* A second pointer device, a VNC server's remote pointer, say,
120+
* alongside the physical touchscreen rather than instead of it. An
121+
* empty string means none: a string option always exists, only its
122+
* content says whether it was configured.
123+
*/
124+
125+
if (CONFIG_EXAMPLES_LVGLDEMO_UTOUCH_DEVPATH[0] != '\0')
126+
{
127+
info.utouch_path = CONFIG_EXAMPLES_LVGLDEMO_UTOUCH_DEVPATH;
128+
}
129+
#endif
118130
#endif
119131

120132
lv_nuttx_init(&info, &result);

0 commit comments

Comments
 (0)