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

feat: Shift Registers for Shift+Trigger operations #11

Merged
merged 8 commits into from
Nov 22, 2023

Conversation

jstarpl
Copy link
Member

@jstarpl jstarpl commented Aug 2, 2023

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Feature

  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?

You can set up actions that modify an internal, global set of "Shift Registers" in the Input Gateway. The "Shift registers" state modifies the triggers emitted from Input Gateway by prefixing the trigger string with a string describing the Shift Registers state, effectively creating a new trigger. This allows for creating "Shift + Key" operations, latching "modes", pagination and cascading menus.

  • Other information:

@jstarpl jstarpl requested a review from nytamin August 18, 2023 09:18
Copy link
Contributor

@nytamin nytamin left a comment

Choose a reason for hiding this comment

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

Great work!
This will be a very powerful and generic addition!

One note that I have is that there should probably be some written documentation detailing the overall shiftRegister functionality, possibly along with some basic examples (what actually happens when shift+S is pressed, how a page is set up etc).

packages/input-gateway/src/inputManagerHandler.ts Outdated Show resolved Hide resolved
packages/input-gateway/src/inputManagerHandler.ts Outdated Show resolved Hide resolved
packages/input-manager/src/devices/feedbackStore.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,35 @@
import { SomeFeedback } from '../feedback/feedback'

export class FeedbackStore<T extends SomeFeedback> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: You're not really using this class as a generic anywhere, perhaps just use SomeFeedback directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I'm not using it right now, but the plan was that the FeedbackStore could be used for objects enhancing the SomeFeedback interface, that's why it's generic.

packages/input-manager/src/devices/feedbackStore.ts Outdated Show resolved Hide resolved
@jstarpl jstarpl merged commit 881548b into develop Nov 22, 2023
4 checks passed
@jstarpl jstarpl deleted the feat/input-gw-shift branch November 22, 2023 13:49
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