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

Maker: Alias accelerometer tap events #13061

Merged
merged 1 commit into from Feb 6, 2017
Merged

Maker: Alias accelerometer tap events #13061

merged 1 commit into from Feb 6, 2017

Conversation

islemaster
Copy link
Contributor

@islemaster islemaster commented Feb 4, 2017

The recent playground-io upgrade introduces tap:single and tap:double events for the accelerometer. This change allows students to refer to these events as singleTap and doubleTap, and adds those events to the onBoardEvent second parameter dropdown. (spec)

image

I considered doing this aliasing in a wrapper around the Accelerometer controller, but there seems to be enough trouble with initialization and resets that this broke some behaviors. I think it's cleaner for now to just alias at the onBoardEvent level and revisit this if/when we manage to simplify the run/reset process.

The recent playground-io upgrade introduces `tap:single` and `tap:double` events for the accelerometer.  This change allows students to refer to these events as `singleTap` and `doubleTap`, and adds those events to the `onBoardEvent` second parameter dropdown.

I considered doing this aliasing in a wrapper around the `Accelerometer` controller, but there seems to be enough trouble with initialization and resets that this broke some behaviors.  I think it's cleaner for now to just alias at the `onBoardEvent` level and revisit this if/when we manage to simplify the run/reset process.
// https://docs.google.com/document/d/1VuDefx4wijBkyiap-36qpfCAoNEzu5B7yLldhhhuv7U/edit#bookmark=id.daat8jt8eda8
if (BOARD_EVENT_ALIASES[event]) {
event = BOARD_EVENT_ALIASES[event];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Love it when previously-established structure makes it possible for additions like this to be clean and simple!

@islemaster islemaster merged commit b145678 into staging Feb 6, 2017
@islemaster islemaster deleted the maker-tap-events branch February 6, 2017 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants