Svelte Flow: bluring window and opening context menu now releases all pressed keys
This commit is contained in:
@@ -40,6 +40,14 @@
|
||||
return isKeyObject(key) ? key.key : key;
|
||||
}
|
||||
|
||||
function resetAll() {
|
||||
selectionKeyPressed.set(false);
|
||||
multiselectionKeyPressed.set(false);
|
||||
deleteKeyPressed.set(false);
|
||||
panActivationKeyPressed.set(false);
|
||||
zoomActivationKeyPressed.set(false);
|
||||
}
|
||||
|
||||
$: selectionKeyDefinition = {
|
||||
key: getKeyString(selectionKey),
|
||||
modifier: getModifier(selectionKey)
|
||||
@@ -67,6 +75,8 @@
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
on:blur={resetAll}
|
||||
on:contextmenu={resetAll}
|
||||
use:shortcut={{
|
||||
trigger: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user