Skip to content

refactor key scans and add gamepad button/axes scans - #46

Open
harbdog wants to merge 25 commits into
quasilyte:masterfrom
harbdog:gamepad_scanning
Open

refactor key scans and add gamepad button/axes scans#46
harbdog wants to merge 25 commits into
quasilyte:masterfrom
harbdog:gamepad_scanning

Conversation

@harbdog

@harbdog harbdog commented Aug 2, 2026

Copy link
Copy Markdown
Contributor
  • Leverage the ebitengine "just released" inpututil functions to simplify existing keyboard key scanning and add gamepad and mouse button scanning capability.
  • Add gamepad axes scanning capability.
  • Example axes scanning with moveable "character" added to _examples/remap.

@harbdog

harbdog commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@quasilyte what are your thoughts on this refactored approach to key scanning? I'm also hoping to later add ability to scan for mouse buttons, maybe even gamepad axes.

@quasilyte

Copy link
Copy Markdown
Owner

I do like the idea to make it better! I only had a limited use of it to implement the in-game key rebinding. The lack of the mouse scanning, for instance, was noticeable even there.
So please go ahead :D

@harbdog harbdog changed the title refactor key scans and add gamepad button scans refactor key scans and add gamepad/mouse button scans Aug 2, 2026
@quasilyte

Copy link
Copy Markdown
Owner

Ping me when it's ready for review/merge.

- only JustPressedActionInfo previously handled mouse wheel events
- also had to swap wheel up/down determination since
  it was reporting the reverse when remapped
@harbdog

harbdog commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

I've gotten mouse wheel working as well, next up is figuring out mouse axes since this does not appear to be a "Key" managed by ebitengine-input at the moment like other axes such as gamepad sticks.

@harbdog
harbdog marked this pull request as ready for review August 8, 2026 21:30
@harbdog

harbdog commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@quasilyte I think it's in a good place now, I also went ahead and added mouse move as a "key" that can be bound to an action and scanned for remapping :)

@harbdog harbdog changed the title refactor key scans and add gamepad/mouse button scans refactor key scans and add gamepad/mouse button/axes scans Aug 8, 2026
@harbdog

harbdog commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

I went back and improved the example after trying to translate it to how my game uses scanning and finding it needed to be made clearer on toggling the different scan types independently.

@harbdog
harbdog marked this pull request as draft August 9, 2026 19:39
@harbdog

harbdog commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Back to draft, found an issue where my game using ebitenui is not picking up mouse axes events like the example was, so need to figure that out first.

@harbdog

harbdog commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Figured it out, it was a problem in my game input system setup where I was de-referencing pointers somewhere I shouldn't have and it caused the Handler's System.cursorPos to not be updated on the correct reference: pixelmek-3d/pixelmek-3d@ed47c6c

@harbdog
harbdog marked this pull request as ready for review August 9, 2026 19:58
harbdog added a commit to pixelmek-3d/pixelmek-3d that referenced this pull request Aug 9, 2026
- temporarily using go mod replace until PR is accepted:
  quasilyte/ebitengine-input#46
Comment thread scan_key_test.go
Comment thread internal_key.go Outdated
Comment thread scan_key.go Outdated
- separating out the mouse motion code to focus this PR on
  adding gamepad and axis scanning capability
@harbdog
harbdog marked this pull request as draft August 18, 2026 00:49
@harbdog harbdog changed the title refactor key scans and add gamepad/mouse button/axes scans refactor key scans and add gamepad button/axes scans Aug 18, 2026
@harbdog
harbdog marked this pull request as ready for review August 22, 2026 01:14
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.

2 participants