Skip to content

Commit 34df408

Browse files
committed
graphics/input: Add getevent input event monitor tool.
Add getevent utility for monitoring input events including mouse clicks/movement, multi-touch coordinates/pressure, and keyboard key presses. Supports automatic device detection in /dev and command-line device path specification with non-blocking I/O. Signed-off-by: liuhongchao <[email protected]>
1 parent 073df9d commit 34df408

5 files changed

Lines changed: 624 additions & 1 deletion

File tree

graphics/input/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,17 @@ if(CONFIG_GRAPHICS_INPUT_TOOL)
6262
SRCS
6363
generator/input.c)
6464
endif()
65+
66+
if(CONFIG_GRAPHICS_INPUT_GETEVENT)
67+
nuttx_add_application(
68+
MODULE
69+
${CONFIG_GRAPHICS_INPUT_GETEVENT}
70+
NAME
71+
getevent
72+
STACKSIZE
73+
${CONFIG_GRAPHICS_INPUT_GETEVENT_STACKSIZE}
74+
PRIORITY
75+
${CONFIG_GRAPHICS_INPUT_GETEVENT_PRIORITY}
76+
SRCS
77+
getevent/getevent.c)
78+
endif()

graphics/input/Kconfig

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,39 @@ config GRAPHICS_INPUT_TOOL_PRIORITY
5959
The priority of the input task.
6060

6161
endif # GRAPHICS_INPUT_TOOL
62+
63+
menuconfig GRAPHICS_INPUT_GETEVENT
64+
tristate "Enable getevent tool"
65+
default n
66+
---help---
67+
The getevent is a command-line input event monitor. It
68+
captures and displays real-time events from mouse,
69+
touchscreen, and keyboard devices via the input subsystem.
70+
71+
Use getevent to debug and verify input drivers, inspect
72+
raw event data during device bring-up, or diagnose
73+
input issues on a running system. It supports automatic
74+
device detection in /dev as well as manual device path
75+
specification.
76+
77+
if GRAPHICS_INPUT_GETEVENT
78+
79+
config GRAPHICS_INPUT_GETEVENT_STACKSIZE
80+
int "getevent stack size"
81+
default DEFAULT_TASK_STACKSIZE
82+
---help---
83+
The size of stack allocated for the getevent task.
84+
85+
config GRAPHICS_INPUT_GETEVENT_PRIORITY
86+
int "getevent priority"
87+
default 100
88+
---help---
89+
The priority of the getevent task.
90+
91+
config GRAPHICS_INPUT_GETEVENT_DETAIL_INFO
92+
bool "getevent detail info"
93+
default n
94+
---help---
95+
Enable detailed information in getevent output.
96+
97+
endif # GRAPHICS_INPUT_GETEVENT

graphics/input/Make.defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
#
2121
############################################################################
2222

23-
ifneq ($(CONFIG_GRAPHICS_INPUT_GENERATOR),)
23+
ifneq ($(CONFIG_GRAPHICS_INPUT_GENERATOR)$(CONFIG_GRAPHICS_INPUT_GETEVENT),)
2424
CONFIGURED_APPS += $(APPDIR)/graphics/input
2525
endif

graphics/input/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,16 @@ MODULE += $(CONFIG_GRAPHICS_INPUT_TOOL)
5050
MAINSRC += generator/input.c
5151
endif
5252

53+
# getevent tool
54+
55+
ifneq ($(CONFIG_GRAPHICS_INPUT_GETEVENT),)
56+
PROGNAME += getevent
57+
PRIORITY += $(CONFIG_GRAPHICS_INPUT_GETEVENT_PRIORITY)
58+
STACKSIZE += $(CONFIG_GRAPHICS_INPUT_GETEVENT_STACKSIZE)
59+
MODULE += $(CONFIG_GRAPHICS_INPUT_GETEVENT)
60+
61+
MAINSRC += getevent/getevent.c
62+
CFLAGS += -Wno-discarded-qualifiers
63+
endif
64+
5365
include $(APPDIR)/Application.mk

0 commit comments

Comments
 (0)