Skip to content

Conversation

@zeropt
Copy link

@zeropt zeropt commented Nov 19, 2025

Made additions to InkHUD for navigating with the joystick on the Seeed Wio Tracker L1 E-ink

Key changes:

  • Modified seeed_wio_tracker_L1_eink/nicheGraphics.h to enable joystick navigation and connect joystick events to InkHUD handlers
  • TwoButtonExtended mirrors the functionality TwoButton but with additional joystick specific functions
  • Up, down, left, right, and center handlers added to InkHUD with matching events in Events
  • Add prevApplet and prevTile to WindowManager
  • Added persistent settings for enabling the joystick and rotating it relative to the screen
  • Declare additional input handlers in Applet and handle joystick inputs in TipsApplet, NotificationApplet, and Menu Applet
  • Add AlignStickApplet for aligning the joystick to the screen (accessible through the menu)
  • MenuApplet stores previous page data for navigating backwards through the menu
  • Update the Tips Applet to describe basic joystick navigation and show the Align Stick Applet after if the joystick is enabled and not aligned

Align Joystick Applet:

20251118_193732
20251118_193855

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Seeed Wio Tracker L1 E-ink (with joystick disabled)
    • Seeed Wio Tracker L1 E-ink (with joystick enabled)
    • Other InkHUD capable devices

We have only tested our changes on the Seeed Wio Tracker L1 E-ink by setting the settings->joystick.enable to true and false to confirm that navigation with and without a joystick still works properly.

scobert969 and others added 13 commits November 16, 2025 16:29
settings->joystick.enabled setting added and SETTINGS_VERSION
incremented by one in InkHUD/Persistence.h

in seeed_wio_tracker_L1_eink/nicheGraphics.h enable joystick and
disable "Next Tile" menu item in

implement prevTile and prevApplet functions in
InkHUD/WindowManager.h,cpp and InkHUD/InkHUD.h,cpp

onStickCenterShort, onStickCenterLong, onStickUp, onStickDown,
onStickLeft, and onStickRight functions added to:
- InkHUD/InkHUD.h,cpp
- InkHUD/Events.h,cpp
- InkHUD/Applet.h

change navigation actions in InkHUD/Events.cpp events based on
whether the joystick is enabled or not

in seeed_wio_tracker_L1_eink/nicheGraphics.h connect joystick events to
the new joystick handler functions
Both the joystick center short press and the user button short press can
be used to advance through the Tips applet.

dismiss notifications with any joystick input
allows menu navigation including a back button
add joystick.aligned and joystick.alignment to InkHUD/Persistence.h for
storing alignment status and relative angle

create AlignStick applet that prompts the user for a joystick input and
rotates the controls to align with the screen

AlignStick applet is run after the tips applet if the joystick is
enabled and not aligned

add menu item for opening the AlignStick applet
@Sabering1
Copy link

Tested it out and it works great. resolves #8161

IMG_4513.compressed.mp4

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive joystick navigation support for the Seeed Wio Tracker L1 E-ink device. The implementation extends the existing button input system to handle a 5-way joystick (4 directions + center press) while maintaining backward compatibility with devices that only have buttons.

Key changes:

  • Created TwoButtonExtended class that mirrors TwoButton functionality with added support for 4-directional joystick inputs
  • Added joystick input handlers throughout InkHUD architecture with directional rotation logic based on screen orientation
  • Implemented AlignStickApplet for calibrating joystick orientation to the screen

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
variants/nrf52840/seeed_wio_tracker_L1_eink/nicheGraphics.h Configures joystick hardware wiring and connects handlers to InkHUD
src/graphics/niche/Inputs/TwoButtonExtended.h Header for extended input class supporting joystick directions
src/graphics/niche/Inputs/TwoButtonExtended.cpp Implementation of joystick input handling with interrupt-driven detection
src/graphics/niche/InkHUD/WindowManager.h Declares prev navigation methods
src/graphics/niche/InkHUD/WindowManager.cpp Implements backward navigation for tiles and applets
src/graphics/niche/InkHUD/Persistence.h Adds persistent settings for joystick enable/alignment
src/graphics/niche/InkHUD/InkHUD.h Declares joystick event handlers
src/graphics/niche/InkHUD/InkHUD.cpp Implements joystick rotation transformation logic
src/graphics/niche/InkHUD/Events.h Declares joystick event methods
src/graphics/niche/InkHUD/Events.cpp Routes joystick events to appropriate applets
src/graphics/niche/InkHUD/Applet.h Adds virtual joystick handler methods to base class
src/graphics/niche/InkHUD/Applets/System/Tips/TipsApplet.h Declares joystick input handler
src/graphics/niche/InkHUD/Applets/System/Tips/TipsApplet.cpp Updates tips text for joystick navigation
src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.h Declares joystick handlers
src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp Implements dismiss on any joystick input
src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h Declares joystick navigation methods and previous page tracking
src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp Implements joystick menu navigation including back button
src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h Adds ALIGN_JOYSTICK menu action
src/graphics/niche/InkHUD/Applets/System/AlignStick/AlignStickApplet.h Header for joystick alignment calibration applet
src/graphics/niche/InkHUD/Applets/System/AlignStick/AlignStickApplet.cpp Implements visual calibration UI with arrow graphics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return;

// Find the index of the applet currently shown on the tile
uint8_t appletIndex = -1;
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Variable appletIndex is initialized to -1 but has type uint8_t (unsigned). This will wrap to 255. Use int8_t or a signed integer type instead, or initialize to a value like UINT8_MAX and check against that.

Copilot uses AI. Check for mistakes.
}

// Confirm that we did find the applet
assert(appletIndex != (uint8_t)-1);
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Comparing unsigned appletIndex to (uint8_t)-1 (255). While this works, it's clearer to use 255 or UINT8_MAX for unsigned comparisons, or switch to a signed type.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants