ENH:keyboard shortcut in macos

1.fix:global shortcut cannot use in webview panel
2.fix:ban original web-shortcut in webview
3.add cmd+q & cmd+h shortcut in macos
4.move some global shortcut to prepare panel

Change-Id: I17ba3c86069dab92df754a319d0c0c3d77b34d74
This commit is contained in:
liz.li 2022-07-26 16:14:42 +08:00 committed by Lane.Wei
parent 042e17952c
commit 1a8e5295b2
4 changed files with 147 additions and 57 deletions

View file

@ -215,4 +215,16 @@ function BeginDownloadNetworkPlugin()
SendWXMessage( JSON.stringify(tSend) );
}
function OutputKey(keyCode, isCtrlDown, isShiftDown, isCmdDown) {
var tSend = {};
tSend['sequence_id'] = Math.round(new Date() / 1000);
tSend['command'] = "get_web_shortcut";
tSend['key_event'] = {};
tSend['key_event']['key'] = keyCode;
tSend['key_event']['ctrl'] = isCtrlDown;
tSend['key_event']['shift'] = isShiftDown;
tSend['key_event']['cmd'] = isCmdDown;
SendWXMessage(JSON.stringify(tSend));
}
window.postMessage = HandleStudio;