changeKeys
This commit is contained in:
parent
18ba62e853
commit
4a33194f7a
8
app.js
8
app.js
@ -74,14 +74,16 @@ const KEY_NAMES = {
|
|||||||
["ArrowUp"]: "↑",
|
["ArrowUp"]: "↑",
|
||||||
["ArrowDown"]: "↓",
|
["ArrowDown"]: "↓",
|
||||||
[" "]: "Espace",
|
[" "]: "Espace",
|
||||||
["Escape"]: "Échap",
|
["Escape"]: "Échap.",
|
||||||
|
["Backspace"]: "Ret. arrière",
|
||||||
["Enter"]: "Entrée",
|
["Enter"]: "Entrée",
|
||||||
["←"]: "ArrowLeft",
|
["←"]: "ArrowLeft",
|
||||||
["→"]: "ArrowRight",
|
["→"]: "ArrowRight",
|
||||||
["↑"]: "ArrowUp",
|
["↑"]: "ArrowUp",
|
||||||
["↓"]: "ArrowDown",
|
["↓"]: "ArrowDown",
|
||||||
["Espace"]: " ",
|
["Espace"]: " ",
|
||||||
["Échap"]: "Escape",
|
["Échap."]: "Escape",
|
||||||
|
["Ret. arrière"]: "Backspace",
|
||||||
["Entrée"]: "Enter",
|
["Entrée"]: "Enter",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -549,7 +551,7 @@ class Settings {
|
|||||||
|
|
||||||
window.changeKey = function (input) {
|
window.changeKey = function (input) {
|
||||||
let prevValue = input.value
|
let prevValue = input.value
|
||||||
input.select()
|
input.value = ""
|
||||||
input.onkeydown = function (event) {
|
input.onkeydown = function (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
input.value = KEY_NAMES[event.key] || event.key
|
input.value = KEY_NAMES[event.key] || event.key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user