mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-11 05:16:12 +00:00
emscripten: Disable default browser keys
This will attempt to disable the default action of some of the browser hotkeys.
This commit is contained in:
parent
5afb197198
commit
156541ed89
@ -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);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user