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

Custom keyboard action #822

Closed
haldo98 opened this issue Jan 5, 2023 · 4 comments
Closed

Custom keyboard action #822

haldo98 opened this issue Jan 5, 2023 · 4 comments
Labels
Milestone

Comments

@haldo98
Copy link

haldo98 commented Jan 5, 2023

Describe the feature

https://photo-sphere-viewer.js.org/guide/config.html#keyboard

The keybord action are the ones listed above.
Have you considered a custom action that can be triggered by pressing a key ?

I was thinking about the immersive mode in the fullscreen mode - hiding bar and compass - with, for instance, pressing the "H" key on the keyboard. Or other custom actions....

Alternatives you've considered

No response

Additional context

No response

@haldo98 haldo98 added the feature label Jan 5, 2023
@mistic100
Copy link
Owner

I could add to possibility to configure a callback for specific keys in addition to existing constants.

@mistic100 mistic100 added this to the 5.0.2 milestone Jan 5, 2023
@mistic100
Copy link
Owner

Will be possible in the next version

keyboard: {
...PhotoSphereViewer.DEFAULTS.keyboard,
'h': (viewer) => {
if (viewer.panel.isVisible('help')) {
viewer.panel.hide();
} else {
viewer.panel.show({
id: 'help',
content: 'Help content',
});
}
},
},

@haldo98
Copy link
Author

haldo98 commented Jan 5, 2023

Great!!!!!

@github-actions
Copy link

github-actions bot commented Jan 7, 2023

This feature/bug fix has been released in version 5.0.2.

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

No branches or pull requests

2 participants