✨ 支持command快捷键
This commit is contained in:
@@ -94,6 +94,25 @@ fn main() -> wry::Result<()> {
|
||||
domEl.addEventListener('touchstart', (e) => {
|
||||
window.ipc.postMessage('drag_window');
|
||||
})
|
||||
|
||||
document.addEventListener('keyup', function (event) {
|
||||
if (event.key == "ArrowUp" && event.metaKey){
|
||||
scrollTo(0,0);
|
||||
}
|
||||
if (event.key == "ArrowDown" && event.metaKey){
|
||||
window.scrollTo(0, document.body.scrollHeight);
|
||||
}
|
||||
if (event.key == "ArrowLeft" && event.metaKey){
|
||||
window.history.go(-1);
|
||||
}
|
||||
if (event.key == "ArrowRight" && event.metaKey){
|
||||
window.history.go(1);
|
||||
}
|
||||
if (event.key == "r" && event.metaKey){
|
||||
window.location.reload();
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
})();
|
||||
"#;
|
||||
@@ -119,7 +138,7 @@ fn main() -> wry::Result<()> {
|
||||
};
|
||||
|
||||
let _webview = WebViewBuilder::new(window)?
|
||||
.with_url("https://weread.qq.com/")?
|
||||
.with_url("https://witeboard.com/")?
|
||||
// .with_devtools(true)
|
||||
.with_initialization_script(script)
|
||||
.with_ipc_handler(handler)
|
||||
|
||||
Reference in New Issue
Block a user