fix: Shortcuts not working correctly in Web build

This commit is contained in:
WerWolv
2024-12-25 01:34:11 +01:00
parent 6005af1595
commit 621d529682
4 changed files with 67 additions and 64 deletions

View File

@@ -25,6 +25,10 @@ EM_JS(void, resizeCanvas, (), {
js_resizeCanvas();
});
EM_JS(bool, isMacOS, (), {
return navigator.userAgent.indexOf('Mac OS X') != -1
});
EM_JS(void, fixCanvasInPlace, (), {
document.getElementById('canvas').classList.add('canvas-fixed');
});
@@ -126,6 +130,9 @@ namespace hex {
if (themeFollowSystem)
EventOSThemeChanged::post();
if (isMacOS())
ShortcutManager::enableMacOSMode();
}
void Window::beginNativeWindowFrame() {