refactor(core): [CORE-23] complete keyboard controls and focus lifecycle

This commit is contained in:
Harvey Zhao committed 2026-09-11 21:06:33 +08:00
1 parent faaa3e8c2d
commit 8ed0a5228c
190 files changed
+53981 -489

No files matched your search

@@ -0,0 +1,14 @@
const handled = new WeakSet<KeyboardEvent>()
export function claimKey(event: KeyboardEvent): void {
handled.add(event)
event.preventDefault()
}
export function isClaimedKey(event: KeyboardEvent): boolean {
return handled.has(event)
}
export function plainKey(event: KeyboardEvent): boolean {
return !event.altKey && !event.ctrlKey && !event.metaKey && !event.isComposing && event.keyCode !== 229
}