debug: add logging to mobile keyboard modifier handling

Adding console.log statements to trace when input events fire
and when deactivateModifiers is called, to diagnose why modifiers
stay sticky on mobile.
This commit is contained in:
GitHub Copilot
2026-01-29 20:42:51 +00:00
parent f934d65745
commit d4b292e636
2 changed files with 5 additions and 2 deletions
File diff suppressed because one or more lines are too long
+3
View File
@@ -662,6 +662,7 @@ class WebTerminal {
// Handle input from mobile keyboard (regular text only, special keys handled above) // Handle input from mobile keyboard (regular text only, special keys handled above)
textarea.addEventListener("input", () => { textarea.addEventListener("input", () => {
const value = textarea.value; const value = textarea.value;
console.log("[webterm:mobile] input event fired, value:", value, "ctrlActive:", this.ctrlActive, "shiftActive:", this.shiftActive);
if (value) { if (value) {
let toSend = value; let toSend = value;
// Apply Shift modifier (uppercase letters) // Apply Shift modifier (uppercase letters)
@@ -675,6 +676,7 @@ class WebTerminal {
toSend = String.fromCharCode(code - 64); // Ctrl+A = 0x01, Ctrl+D = 0x04, etc. toSend = String.fromCharCode(code - 64); // Ctrl+A = 0x01, Ctrl+D = 0x04, etc.
} }
} }
console.log("[webterm:mobile] sending:", toSend.charCodeAt(0), "calling deactivateModifiers");
this.send(["stdin", toSend]); this.send(["stdin", toSend]);
textarea.value = ""; textarea.value = "";
this.deactivateModifiers(); this.deactivateModifiers();
@@ -938,6 +940,7 @@ class WebTerminal {
/** Deactivate all modifiers */ /** Deactivate all modifiers */
private deactivateModifiers(): void { private deactivateModifiers(): void {
console.log("[webterm:mobile] deactivateModifiers called");
this.ctrlActive = false; this.ctrlActive = false;
this.shiftActive = false; this.shiftActive = false;
this.mobileKeybar?.querySelectorAll("button[data-modifier]").forEach((btn) => { this.mobileKeybar?.querySelectorAll("button[data-modifier]").forEach((btn) => {