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;
|
return isKeyObject(key) ? key.key : key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetAll() {
|
||||||
|
selectionKeyPressed.set(false);
|
||||||
|
multiselectionKeyPressed.set(false);
|
||||||
|
deleteKeyPressed.set(false);
|
||||||
|
panActivationKeyPressed.set(false);
|
||||||
|
zoomActivationKeyPressed.set(false);
|
||||||
|
}
|
||||||
|
|
||||||
$: selectionKeyDefinition = {
|
$: selectionKeyDefinition = {
|
||||||
key: getKeyString(selectionKey),
|
key: getKeyString(selectionKey),
|
||||||
modifier: getModifier(selectionKey)
|
modifier: getModifier(selectionKey)
|
||||||
@@ -67,6 +75,8 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window
|
<svelte:window
|
||||||
|
on:blur={resetAll}
|
||||||
|
on:contextmenu={resetAll}
|
||||||
use:shortcut={{
|
use:shortcut={{
|
||||||
trigger: [
|
trigger: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user