Skip to content

Commit d58778c

Browse files
authored
Update test.html
1 parent 9f02c4a commit d58778c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,15 @@ <h3>反向查詢 (輸入單一中文字)</h3>
455455
document.addEventListener('keydown', (event) => {
456456
const key = event.key.toLowerCase();
457457
const keys = "abcdefghijklmnopqrstuvwxyz;,.";
458-
458+
459459
// 使用 Shift 鍵切換模式
460460
if (event.key === "Shift") {
461+
if (event.repeat) return; // 避免在長按時重複觸發
461462
isEnglishMode = !isEnglishMode;
462463
updateModeDisplay();
463464
updateKeyboardDisplay();
464465
resetInputState();
465-
event.preventDefault(); // 避免 Shift 鍵的預設行為
466+
event.preventDefault();
466467
return;
467468
}
468469

@@ -537,7 +538,6 @@ <h3>反向查詢 (輸入單一中文字)</h3>
537538
searchResult.textContent = '查詢結果顯示在此';
538539
}
539540
});
540-
541541
</script>
542542
</body>
543543
</html>

0 commit comments

Comments
 (0)