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

allow user to start and escape experiments with keyboard and vr controllers #288

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pellet
Copy link
Contributor

@pellet pellet commented Dec 10, 2024

These changes allow for some simple built-in functionality for using the oculus/quest VR controllers for kicking off experiments or exiting them early.

I've also changed the behavior of the keyboard for exiting an experiment, it now requires pressing the escape key instead of any key to exit. This helps to prevent accidental exits, but I can change it back if wanted(maybe it's going to make it harder for users to exit on purpose?).

The __clear_user_input() and __user_input() methods are used internally by the BaseExperiment class for clearing the input buffer and detecting input respectively for both keyboard and vr controllers.

The get_vr_input() and get_vr_input() methods are used internally too, but can also be used by the child Experiment classes for simple VR input, either via a xbox or touch controller button and trigger.

Any feedback on how to improve the code change will be appreciated, I've just aimed to get it working in the most basic way I could, it should hopefully give experiment writers a good starting point on how to use the controllers.

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.

1 participant