禁止默认的全选行为

pull/1761/head
lyswhut 2023-12-08 16:34:28 +08:00
parent 42109ce000
commit f40f019d2e
1 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,9 @@ const handle_fullscreen = (event: LX.KeyDownEevent) => {
isFullscreen.value = fullscreen
})
}
const handle_selection = (event: LX.KeyDownEevent) => {
event.event?.preventDefault()
}
export default () => {
watch(isFullscreen, val => {
@ -126,6 +129,7 @@ export default () => {
window.app_event.on('keyDown', handle_key_down)
window.key_event.on('key_mod+f12_down', handle_open_devtools)
window.key_event.on('key_f11_down', handle_fullscreen)
window.key_event.on('key_mod+a_down', handle_selection)
document.body.addEventListener('click', handleBodyClick, true)
onBeforeUnmount(() => {
@ -136,6 +140,7 @@ export default () => {
window.app_event.off('keyDown', handle_key_down)
window.key_event.off('key_mod+f12_down', handle_open_devtools)
window.key_event.off('key_f11_down', handle_fullscreen)
window.key_event.off('key_mod+a_down', handle_selection)
document.body.removeEventListener('click', handleBodyClick)
rSetConfig()
rFocus()