emscripten: Disable default browser keys

This will attempt to disable the default action of some of the browser hotkeys.
This commit is contained in:
Rob Loach 2016-09-05 02:17:15 -04:00 committed by GitHub
parent 5afb197198
commit 156541ed89

View File

@ -230,5 +230,15 @@ $(function() {
$.getScript(core + '_libretro.js', function () {
// Activate the Start RetroArch button.
$('#btnStart').removeClass('disabled');
/**
* Attempt to disable some default browser keys.
*/
window.addEventListener('keydown', function(e) {
// Space key, arrows, and F1.
if([32, 37, 38, 39, 40, 112].indexOf(e.keyCode) > -1) {
e.preventDefault();
}
}, false);
});
});