(e: KeyboardEvent)
| 470 | } |
| 471 | if (!checkItems.size) return; |
| 472 | const sharedKeyPressListner = (e: KeyboardEvent) => { |
| 473 | const keyUpper = e.key.toUpperCase(); |
| 474 | checkItems.forEach(([uuid, accessKeyUpper, _name, menuItems]) => { |
| 475 | if (keyUpper === accessKeyUpper) { |
| 476 | // 快速键触发不需传递 options(autoClose 由 sendMenuAction 内部处理)。 |
| 477 | sendMenuAction(uuid, {}, menuItems); |
| 478 | } |
| 479 | }); |
| 480 | }; |
| 481 | document.addEventListener("keypress", sharedKeyPressListner); |
| 482 | return () => { |
| 483 | checkItems.clear(); |
nothing calls this directly
no test coverage detected