add art.isInput

This commit is contained in:
Harvey Zack committed 2022-05-15 07:42:28 +08:00
1 parent 3741f876d5
commit 2b934ab988
5 files changed
+10 -4

No files matched your search

@@ -8,9 +8,11 @@ export default function clickInit(art, events) {
events.proxy(document, ['click', 'contextmenu'], (event) => {
if (includeFromEvent(event, $player)) {
art.isInput = event.target.tagName === 'INPUT';
art.isFocus = true;
art.emit('focus');
} else {
art.isInput = false;
art.isFocus = false;
art.emit('blur');
}