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 for setting control schemes based on the preview type #701

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

Conversation

agentd00nut
Copy link

Fixes #700

Preview exports a "setControllerType" function that just sets its "controlsType" to a string.

The onKeydown event is changed to a switch case that defaults to the default controls as they are now. But if the controlsType matches a switch it will pass the event to a different function which can set the controls slightly differently.

In this case we stop listening for the space key and left and right arrows for "vid"eos. This lets the video playback pan left and right with the arrow keys and pause and start with spacebar, as most default video players work.

This makes adding new control schemes easy for each preview-TYPE.js.

I do think adding a "?" somewhere on the preview screen that allows for a snippet about what the controls for this preview are would be helpful... For example it's unlikely users would find out that "." and "," can be used in the video preview to skip to the next and previous video.

It should also be configurable by the main config.json to allow turning on and off the controls ( even setting them?? ) because technically now a dir with images and videos will change controls depending on the media shown.

Lastly maybe the best approach would have just been to change the default controls to slightly less common keys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants