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

Feature: shell tap command #1318

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

petejohanson
Copy link
Contributor

Initial work on making the Zephyr Shell useful for ZMK.

  • Fixes for our Kconfig that enables SENSOR to not force it on all the time, which helps for native_posix_64 target builds.
    *Minor native_posix_64 tweaks to allow building without any simulated kscan events, since we will use the shell for that instead.
  • Shell command! Can do key tap 0 to generate press then release of the 0th key position.

This is useful for building a native posix executable to test ZMK by hand, generate key events, test changes to USB via the USB IP native driver, etc.

@petejohanson petejohanson added enhancement New feature or request core Core functionality/behavior of ZMK labels May 26, 2022
@petejohanson petejohanson self-assigned this May 26, 2022
@manna-harbour
Copy link

manna-harbour commented Aug 31, 2022

This is great, thanks! I've tested it and would be happy for it to be merged now.

Suggestions for future work:

@manna-harbour manna-harbour mentioned this pull request Aug 31, 2022
@caksoylar
Copy link
Contributor

How to enable the shell over USB is currently not documented anywhere

I added some instructions for that here: caksoylar/zmk-posix-testbed@e55dd85 However since it didn't work on my system there might be issues. I'd welcome any fixes if there is an issue with the instructions!

@manna-harbour
Copy link

manna-harbour commented Aug 31, 2022

How to enable the shell over USB is currently not documented anywhere

I added some instructions for that here: caksoylar/zmk-posix-testbed@e55dd85 However since it didn't work on my system there might be issues. I'd welcome any fixes if there is an issue with the instructions!

Thanks for adding those instructions. Accessing the shell on native POSIX through a pty and using usbip works for me on Linux, apart from #1444, although I did have to manually load modules and some commands require root.

But by accessing the shell over USB, I mean enabling the shell on a physical ZMK MCU board directly connected to the host via USB, and accessing the shell via CDC_ACM in the same way as can be done now with USB logging. It may just require adding https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/shell/shell_module/overlay-usb.conf and https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/shell/shell_module/usb.overlay but I haven't tried that yet.

@manna-harbour
Copy link

I have a working shield with shell over CDC_ACM now, will share after some cleanup.

@manna-harbour
Copy link

I've made something like KMonad using this PR. See manna-harbour/xmk#2.

@instance-id
Copy link

Hello,
I was trying to apply this feature to my Kinesis 360Advantage, but I seem to be stuck. I created a detailed outline of the steps taken in the following Gist. If someone happens to have a few minutes and is willing to take a look to see if they can spot where I might have missed something, I would greatly appreciate it.

https://gist.github.com/instance-id/f52b8efbea082f08de06d08cfe7bb504

Also, if this is not the appropriate place to pose this question, please do let me know and I will remove it and relocate it to the specified location.
Thanks!

* Allow tap/press/release of a given key position
  within the Zephyr shell.
* By default, don't generate any events for the native
  posix board DTS, to allow native builds outside
  of the testing use case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionality/behavior of ZMK enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants