Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input: kbd_matrix: add an kbd_matrix_state shell command #65628

Merged

Conversation

fabiobaltieri
Copy link
Member

@fabiobaltieri fabiobaltieri commented Nov 22, 2023

Add a "input kbd_matrix_state" shell command. This prints the state of a keyboard matrix in a much more compact representation than the normal input event dump, but also keeps track of any key seen during the execution and reports that on the "off" command. The output can be used to help setting the actual-key-mask property (#65703).

@fabiobaltieri fabiobaltieri force-pushed the keyboard-input-shell branch 10 times, most recently from 2dc2a4e to a83995d Compare November 25, 2023 20:48
@fabiobaltieri fabiobaltieri force-pushed the keyboard-input-shell branch 2 times, most recently from e434394 to 861f221 Compare November 29, 2023 16:31
Add a print helper define for the keyboard matrix row paired with the
row typedef.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
@fabiobaltieri fabiobaltieri marked this pull request as ready for review November 29, 2023 19:37
@zephyrbot zephyrbot added area: Input Input Subsystem and Drivers area: Samples Samples labels Nov 29, 2023
@fabiobaltieri
Copy link
Member Author

@gmarull @keith-zephyr ping

drivers/input/Kconfig.kbd_matrix Outdated Show resolved Hide resolved
subsys/input/input_utils.c Show resolved Hide resolved
@@ -119,6 +265,12 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
"usage: dump <on|off>",
input_cmd_dump, 2, 0),
#endif /* CONFIG_INPUT_EVENT_DUMP */
#ifdef CONFIG_INPUT_KBD_MATRIX_STATE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some documentation that guides the user on how to use and interpret the results from this command?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey I'm working on a doc page covering all the keyboard options and gpio keyboard modes (there's plenty enough to justify a whole page imo), will cover that there, I think it'll be the proper context

@fabiobaltieri fabiobaltieri force-pushed the keyboard-input-shell branch 2 times, most recently from 266e6b4 to 0f02a76 Compare December 7, 2023 17:18
keith-zephyr
keith-zephyr previously approved these changes Dec 7, 2023
subsys/input/input_utils.c Outdated Show resolved Hide resolved
subsys/input/input_utils.c Outdated Show resolved Hide resolved
Add a "input kbd_matrix_state" shell command. This prints the state of
a keyboard matrix in a much more compact representation than the normal
input event dump, but also keeps track of any key seen during the
execution and reports that on the "off" command. The output can be used
to help setting the actual-key-mask property.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add a test for the kbd_matrix_state shell command, both 8 and 16 bit row
variants.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Enable INPUT_SHELL and INPUT_KBD_MATRIX_STATE by default if the sample
is compiled with CONFIG_SHELL=y. This makes it easier to use the shell
commands in the sample by just enabling the shell and let any help
command turn on automatically.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
@fabiobaltieri fabiobaltieri merged commit 72bb10d into zephyrproject-rtos:main Dec 8, 2023
20 checks passed
@fabiobaltieri fabiobaltieri deleted the keyboard-input-shell branch December 8, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Input Input Subsystem and Drivers area: Samples Samples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants