-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support keyboard shortcuts in web editor for contributions #11
Labels
Comments
Closed
Keyboard shortcutsAlready implementedBuilt-in with most web browsers
Possible additions
Implementation in JavaScriptwindow.addEventListener("keydown", function (event) {
// if the event has already been processed
if (event.defaultPrevented) {
// do nothing
return;
}
switch (event.key) {
/*case " ":
// Play or pause
break;*/
case "ArrowRight":
if (event.ctrlKey) {
// TODO: Skip forward (plus 20 seconds)
}
else if (event.shiftKey) {
// TODO: Skip forward (plus 1 minute)
}
else if (event.altKey) {
// TODO: Skip forward (plus 4 minutes)
}
else {
// TODO: Skip forward (plus 5 seconds)
}
break;
case "ArrowLeft":
if (event.ctrlKey) {
// TODO: Skip backward (minus 20 seconds)
}
else if (event.shiftKey) {
// TODO: Skip backward (minus 1 minute)
}
else if (event.altKey) {
// TODO: Skip backward (minus 4 minutes)
}
else {
// TODO: Skip backward (minus 5 seconds)
}
break;
case ".":
// TODO: Move to next frame
break;
case ",":
// TODO: Move to previous frame
break;
case "+":
if (event.ctrlKey) {
// TODO: Increase speed (plus 0.1x)
}
else if (event.altKey) {
// TODO: Increase speed (plus 0.02x)
}
else {
// TODO: Increase speed (plus 0.25x)
}
break;
case "-":
if (event.ctrlKey) {
// TODO: Decrease speed (minus 0.1x)
}
else if (event.altKey) {
// TODO: Decrease speed (minus 0.02x)
}
else {
// TODO: Decrease speed (minus 0.25x)
}
break;
case "=":
// TODO: Reset speed (to 1.00x)
break;
case "Delete":
// TODO: Start cut
break;
case "Enter":
// TODO: End cut
break;
case "Insert":
// TODO: Cancel cut
break;
case "ArrowUp":
// TODO: Increase volume (plus 10 %)
break;
case "ArrowDown":
// TODO: Decrease volume (minus 10 %)
break;
/*case "F11":
// Enter or leave fullscreen
break;*/
default:
return;
}
// cancel the default action to avoid the event being handled twice
event.preventDefault();
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: