bespokejs / bespoke-keys Goto Github PK
View Code? Open in Web Editor NEWKeyboard Support for Bespoke.js
License: MIT License
Keyboard Support for Bespoke.js
License: MIT License
Hi there, I'm using bespoke-keys
to scroll to slides using the arrow keys:
bespoke
.from('body', [bespokeKeys('vertical')])
.on('activate', ({ slide }) => {
slide.scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'nearest',
});
return false;
});
But the browser scrolls a bit too far. After troubleshooting I found out it's because the default arrow key event causes a scroll too, calling event.preventDefault
would fix this.
Would this be something to add to the code of this plugin? An alternative would passing keydown event
so it can be used inside the activate
event handler. Thoughts?
Hi @markdalgleish. Would it be ok to update the dependencies for the plugin? I'd be glad to do a PR if you think it's a good idea.
Thanks!
Don't intercept key events that are being sent to an editable input, such as a text area.
Presenters often like to use editable inputs in the presentation to explain concepts, such as an editable source code block. Currently, it's impossible to type into one of these elements without triggering the slide navigation. The plugin should check to ensure that the element is not an editable input before acting on the key event.
Many applications, presentation systems or otherwise, have gotten us used to being able to press the "f" key to enter fullscreen mode. I keep stumbling over this missing keybinding in bespoke.js while presenting. I hope to see this supported by bespoke-keys out of the box.
Ignore keydown events if a modifier key is active (ctrl, shift, alt, etc). This prevents bespoke-keys from intercepting keyboard shortcuts, such as navigating tabs in the browser and such.
Hey @markdalgleish, do you have any interest in a shift + space
keybinding to navigate to the previous slide, or is that out of scope for this plugin?
I can submit a PR if you think it would be a good fit.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.