changeKeys

This commit is contained in:
Adrien MALINGREY 2023-06-14 18:14:14 +02:00
parent 18ba62e853
commit 4a33194f7a

8
app.js
View File

@ -74,14 +74,16 @@ const KEY_NAMES = {
["ArrowUp"]: "↑",
["ArrowDown"]: "↓",
[" "]: "Espace",
["Escape"]: "Échap",
["Escape"]: "Échap.",
["Backspace"]: "Ret. arrière",
["Enter"]: "Entrée",
["←"]: "ArrowLeft",
["→"]: "ArrowRight",
["↑"]: "ArrowUp",
["↓"]: "ArrowDown",
["Espace"]: " ",
["Échap"]: "Escape",
["Échap."]: "Escape",
["Ret. arrière"]: "Backspace",
["Entrée"]: "Enter",
}
@ -549,7 +551,7 @@ class Settings {
window.changeKey = function (input) {
let prevValue = input.value
input.select()
input.value = ""
input.onkeydown = function (event) {
event.preventDefault()
input.value = KEY_NAMES[event.key] || event.key