Added new mooncore js dependencies. Added ace editor build

This commit is contained in:
2025-02-05 16:50:35 +01:00
parent b6b488edf6
commit 2e5d0dcd73
432 changed files with 3530 additions and 13 deletions

View File

@@ -0,0 +1,25 @@
window.moonCoreKeyBinds = {
storage: {},
registerHotkey: function (key, modifier, action, dotNetObjRef) {
const hotkeyListener = async (event) => {
if (event.code === key && (!modifier || event[modifier + 'Key'])) {
event.preventDefault();
await dotNetObjRef.invokeMethodAsync("OnHotkeyPressed", action);
}
};
this.storage[`${key}${modifier}`] = hotkeyListener;
window.addEventListener('keydown', hotkeyListener);
},
unregisterHotkey: function (key, modifier) {
const listenerKey = `${key}${modifier}`;
if (this.storage[listenerKey]) {
window.removeEventListener('keydown', this.storage[listenerKey]);
delete this.storage[listenerKey];
}
}
}