From 0edca9e78d3039d5c4785bbc307a7def3c17ca30 Mon Sep 17 00:00:00 2001 From: mgreminger Date: Mon, 15 Jun 2026 10:48:15 -0500 Subject: [PATCH 1/3] fix: fix comment mode toggle for international keyboards --- src/MathField.svelte | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/MathField.svelte b/src/MathField.svelte index b8fda714..85d46b2c 100644 --- a/src/MathField.svelte +++ b/src/MathField.svelte @@ -128,6 +128,14 @@ mathLiveField.executeCommand(['insert', '^{\\mathrm{T}}']); } break; + case '"': + e.preventDefault(); + if (mathLiveField.mode === 'text') { + mathLiveField.executeCommand(['switchMode', 'math', '', '']); + } else { + mathLiveField.executeCommand(['switchMode', 'text', '', '']); + } + break; case "F10": if(e.shiftKey) { e.preventDefault(); From a9b5bd3b2be11e03ae9ffe8189172c5d88ea00a9 Mon Sep 17 00:00:00 2001 From: mgreminger Date: Mon, 15 Jun 2026 18:32:47 -0500 Subject: [PATCH 2/3] fix: fix superscript handling for keyboards where ^ is a dead key --- src/MathField.svelte | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/MathField.svelte b/src/MathField.svelte index 85d46b2c..33513a9b 100644 --- a/src/MathField.svelte +++ b/src/MathField.svelte @@ -80,7 +80,24 @@ update?.({latex: mathLiveField.value}); } + let isDeadKeyActive = false; function handleKeyDown(e: KeyboardEvent) { + if (isDeadKeyActive && e.key === '^') { + e.stopImmediatePropagation(); + + isDeadKeyActive = false; + return; + } + + if (e.key === 'Dead') { + e.stopImmediatePropagation(); + + isDeadKeyActive = true; + return; + } + + isDeadKeyActive = false; + switch (e.key) { case 'Tab': if(!e.shiftKey) { From fc294ad9f4b6f5f0d6101c92033b0f5446fdb57c Mon Sep 17 00:00:00 2001 From: mgreminger Date: Mon, 15 Jun 2026 21:37:21 -0500 Subject: [PATCH 3/3] refactor: streamline dead key handling for superscript --- src/MathField.svelte | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/MathField.svelte b/src/MathField.svelte index 33513a9b..164dc458 100644 --- a/src/MathField.svelte +++ b/src/MathField.svelte @@ -81,24 +81,21 @@ } let isDeadKeyActive = false; + function handleKeyDown(e: KeyboardEvent) { if (isDeadKeyActive && e.key === '^') { e.stopImmediatePropagation(); - isDeadKeyActive = false; return; } - if (e.key === 'Dead') { - e.stopImmediatePropagation(); - - isDeadKeyActive = true; - return; - } - isDeadKeyActive = false; switch (e.key) { + case 'Dead': + e.stopImmediatePropagation(); + isDeadKeyActive = true; + break; case 'Tab': if(!e.shiftKey) { e.preventDefault();