Merge pull request #3510 from RobLoach/patch-4

emscripten: Disable default browser keys
This commit is contained in:
Andrés 2016-09-05 01:21:14 -05:00 committed by GitHub
commit fab1c0a75c

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);
});
});