Skip to content

feat: add input example with controller - #464

Merged
Miou-zora merged 3 commits into
mainfrom
create-input-example
Feb 2, 2026
Merged

feat: add input example with controller#464
Miou-zora merged 3 commits into
mainfrom
create-input-example

Conversation

@Miou-zora

@Miou-zoraMiou-zora commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new example application for demonstrating input handling using the engine, along with its build configuration. The changes include a new main.cpp that sets up keyboard and joystick input events, and a corresponding xmake.lua build script specifying dependencies and build options.

New Example Application:

  • Added examples/input_usage/src/main.cpp to showcase input handling, including keyboard callbacks and joystick axis/button event printing. The example uses the engine's plugin and resource system for input management.

Build Configuration:

  • Added examples/input_usage/xmake.lua to define the build process for the example, listing required packages (such as glm, glfw, spdlog, etc.), setting project properties, and configuring build modes for debug and release.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added example application demonstrating input handling for keyboard and joystick/controller devices
    • Logs key press and release events with human-readable key names
    • Tracks joystick axes and button state changes with threshold-based event reporting
    • Illustrates proper engine initialization and plugin integration patterns

@Miou-zora
Miou-zora requested a review from a teamJanuary 31, 2026 21:36
@Miou-zoraMiou-zora self-assigned this Jan 31, 2026
@Miou-zoraMiou-zora added the documentation Improvements or additions to documentation label Jan 31, 2026
@coderabbitai

coderabbitaiBot commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces a new example application demonstrating input handling with the Engine framework. It includes a C++ source file implementing keyboard and joystick input polling, alongside an XMake build configuration defining dependencies and compiler settings.

Changes

Cohort / File(s)Summary
Input Example Application
examples/input_usage/src/main.cpp
New example application showcasing input handling: Setup function retrieves InputManager, registers key callback, and logs key events; main function initializes Engine::Core with Input::Plugin, registers startup and continuous polling systems for GLFW joystick state tracking, and runs the engine loop.
Build Configuration
examples/input_usage/xmake.lua
New XMake build script defining InputUsage target with C++20, external dependencies (entt, gtest, glm, glfw, glew, spdlog, fmt, joltphysics, stb), platform-specific compiler flags, debug/release build modes, and project structure settings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • ripel2

Poem

🐰 A humble example, fresh and bright,
Shows input dancing left and right!
Keys and joysticks, pressed with care,
The Engine's input everywhere! 🎮✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch create-input-example

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Miou-zora
Miou-zora merged commit cd99004 into mainFeb 2, 2026
0 of 4 checks passed
@Miou-zora
Miou-zora deleted the create-input-example branch February 2, 2026 20:36
@sonarqubecloud

Copy link
Copy Markdown

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Miou-zora@ripel2