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

WebPlayer: fixes unwanted scrolling on Arrowkey press #1188

Merged
merged 2 commits into from May 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions resources/emscripten/emscripten-shell.html
Expand Up @@ -81,5 +81,14 @@
};
</script>
{{{ SCRIPT }}}
<script>
//prevents scrolling on arrow key press
window.addEventListener("keydown", function(e) {
// space and arrow keys, from 112 to 123 for function keys (only works in some browsers)
if([32, 37, 38, 39, 40, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123].indexOf(e.keyCode) > -1) {
e.preventDefault();
}
}, false);
</script>
</body>
</html>