mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 13:20:43 +00:00
fix menu button
This commit is contained in:
parent
7b3554fd3c
commit
a682ccd8e8
@ -86,7 +86,7 @@
|
||||
<span class="fa fa-trash-o" id="icnClean"></span> <span class="sr-only">Cleanup</span>
|
||||
</button>
|
||||
<input class="btn btn-primary disabled" style="display: none" type="file" id="btnRom" name="upload" onclick="document.getElementById('btnAdd').click();" onchange="selectFiles(event.target.files)" multiple />
|
||||
<button class="btn btn-primary disabled tooltip-enable" id="btnMenu" onclick="keyPress(112);" title="Menu toggle" disabled>
|
||||
<button class="btn btn-primary disabled tooltip-enable" id="btnMenu" onclick="keyPress('F1');" title="Menu toggle" disabled>
|
||||
<span class="fa fa-bars" id="btnMenu"></span> <span class="sr-only">Menu</span>
|
||||
</button>
|
||||
<button class="btn btn-primary disabled tooltip-enable" id="btnFullscreen" onclick="Module.requestFullScreen()" title="Fullscreen" disabled>
|
||||
|
@ -393,31 +393,7 @@ function keyPress(k)
|
||||
}
|
||||
|
||||
kp = function(k, event) {
|
||||
var oEvent = document.createEvent('KeyboardEvent');
|
||||
|
||||
// Chromium Hack
|
||||
Object.defineProperty(oEvent, 'keyCode', {
|
||||
get : function() {
|
||||
return this.keyCodeVal;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(oEvent, 'which', {
|
||||
get : function() {
|
||||
return this.keyCodeVal;
|
||||
}
|
||||
});
|
||||
|
||||
if (oEvent.initKeyboardEvent) {
|
||||
oEvent.initKeyboardEvent(event, true, true, document.defaultView, false, false, false, false, k, k);
|
||||
} else {
|
||||
oEvent.initKeyEvent(event, true, true, document.defaultView, false, false, false, false, k, 0);
|
||||
}
|
||||
|
||||
oEvent.keyCodeVal = k;
|
||||
|
||||
if (oEvent.keyCode !== k) {
|
||||
alert("keyCode mismatch " + oEvent.keyCode + "(" + oEvent.which + ")");
|
||||
}
|
||||
var oEvent = new KeyboardEvent(event, { code: k });
|
||||
|
||||
document.dispatchEvent(oEvent);
|
||||
document.getElementById('canvas').focus();
|
||||
|
Loading…
x
Reference in New Issue
Block a user