Skip to content

Refactor input handlers - #79

Merged
JoseMoreville merged 3 commits into
PlayCover:3.0.0-stagingfrom
XuYicong:master
Feb 22, 2023
Merged

JoseMoreville merged 3 commits into
PlayCover:3.0.0-stagingfrom
XuYicong:master

Conversation

@XuYicong

@XuYicong XuYicong commented Feb 4, 2023

Copy link
Copy Markdown
Member

In the existing code, in the initialization of actions, event handlers are setup, so that this action can be executed whenever corresponding hardware input happens. While in PlayInput there are also event handler setups that serve purposes like keymap editor, it appears that there are multiple places setting up event handlers for the same input device.

This PR aims to construct a unified action registration mechanism, in which actions does not setup event handlers directly, but rather register their handlers to the hardware abstraction layer (aka. PlayInput and PlayMice). The latter is responsible for dispatching hardware events to appropriate receivers.

This would make the code structure clearer and make it easier to add new features, like complete controller support.

@XuYicong
XuYicong changed the base branch from master to 3.0.0-staging February 4, 2023 02:10
@XuYicong
XuYicong marked this pull request as ready for review February 6, 2023 17:21
@JoseMoreville
JoseMoreville merged commit 81bd9c5 into PlayCover:3.0.0-staging Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants