2023-03-07 10:22:43 +01:00
|
|
|
////////////////////////////////////////
|
|
|
|
////////////////////////////////////////
|
|
|
|
// CLAVIER
|
|
|
|
|
|
|
|
function action_clavier_contexte(event){
|
|
|
|
switch (event.key){
|
|
|
|
// selectionner pose
|
2023-03-08 10:50:45 +01:00
|
|
|
// case ' ' :
|
|
|
|
// action_bouton_commencer_contexte('clavier')
|
|
|
|
// break;
|
2023-03-07 10:22:43 +01:00
|
|
|
// valider
|
|
|
|
case 'Enter':
|
2023-03-11 21:20:49 +01:00
|
|
|
if (fin_conexte){action_bouton_commencer_contexte()}
|
|
|
|
else{action_bouton_suivant_commencer()}
|
2023-03-07 10:22:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function action_clavier_inscription(event){
|
|
|
|
switch (event.key){
|
|
|
|
// selectionner pose
|
2023-03-08 10:50:45 +01:00
|
|
|
// case ' ' :
|
|
|
|
// if (champs_remplis_correctment()){
|
|
|
|
// action_bouton_commencer('clavier')}
|
|
|
|
// break;idx_i, idx_j
|
2023-03-07 10:22:43 +01:00
|
|
|
// valider
|
|
|
|
case 'Enter':
|
2023-03-10 11:48:37 +01:00
|
|
|
if (!inscription_finie){
|
|
|
|
if (champs_remplis_correctment()){
|
|
|
|
action_bouton_suivant_inscription()}
|
|
|
|
}else{
|
|
|
|
action_bouton_commencer_inscription()
|
|
|
|
}
|
2023-03-07 10:22:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-07 18:16:30 +01:00
|
|
|
|
2023-03-07 10:22:43 +01:00
|
|
|
function action_clavier_vues(event){
|
|
|
|
switch (event.key){
|
|
|
|
case 'ArrowLeft':
|
2023-03-10 17:37:58 +01:00
|
|
|
//console.log("deplacement K-G")
|
2023-03-07 10:22:43 +01:00
|
|
|
action_fleche_gauche()
|
|
|
|
//idx_i = (idx_i+1)%8
|
|
|
|
break;
|
|
|
|
case 'ArrowRight' :
|
2023-03-10 17:37:58 +01:00
|
|
|
//console.log("deplacement K-D")
|
2023-03-07 10:22:43 +01:00
|
|
|
action_fleche_droite()
|
|
|
|
//idx_i = (idx_i+7)%8
|
|
|
|
break;
|
|
|
|
case 'ArrowDown' :
|
2023-03-10 17:37:58 +01:00
|
|
|
//console.log("deplacement K-B")
|
2023-03-07 10:22:43 +01:00
|
|
|
action_fleche_bas()
|
|
|
|
//idx_j = Math.min(idx_j+1,4)
|
|
|
|
break;
|
|
|
|
case 'ArrowUp' :
|
2023-03-10 17:37:58 +01:00
|
|
|
//console.log("deplacement K-H")
|
2023-03-07 10:22:43 +01:00
|
|
|
action_fleche_haut()
|
|
|
|
//idx_j = Math.max(idx_j-1,0)
|
|
|
|
break;
|
|
|
|
// selectionner pose
|
|
|
|
case ' ' :
|
|
|
|
action_bouton_pose()
|
|
|
|
break;
|
|
|
|
// retirer
|
|
|
|
case 'Backspace':
|
|
|
|
action_bouton_retirer()
|
|
|
|
break;
|
|
|
|
// reintialiser
|
|
|
|
case 'Delete':
|
|
|
|
action_bouton_reinitialiser()
|
|
|
|
break;
|
|
|
|
// valider
|
|
|
|
case 'Enter':
|
|
|
|
action_bouton_valider()
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function action_clavier_analyse(event){
|
|
|
|
switch (event.key){
|
|
|
|
// selectionner pose
|
|
|
|
// valider
|
|
|
|
case 'Enter':
|
|
|
|
action_bouton_valider_analyse()
|
|
|
|
break;
|
|
|
|
case '1':
|
|
|
|
check_ou_decheck(0)
|
|
|
|
break;
|
|
|
|
case '2':
|
|
|
|
check_ou_decheck(1)
|
|
|
|
break;
|
|
|
|
case '3':
|
|
|
|
check_ou_decheck(2)
|
|
|
|
break;
|
|
|
|
case '4':
|
|
|
|
check_ou_decheck(3)
|
|
|
|
break;
|
|
|
|
case '5':
|
|
|
|
check_ou_decheck(4)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function init_clavier_contexte(){
|
|
|
|
document.addEventListener("keydown", action_clavier_contexte)
|
|
|
|
}
|
|
|
|
|
|
|
|
function init_clavier_inscription(){
|
|
|
|
document.addEventListener("keydown", action_clavier_inscription)
|
|
|
|
}
|
|
|
|
|
2023-03-07 18:16:30 +01:00
|
|
|
|
|
|
|
function init_clavier_explication(){
|
|
|
|
document.addEventListener("keydown", action_clavier_explication)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-03-07 10:22:43 +01:00
|
|
|
function init_clavier_vues(){
|
|
|
|
document.addEventListener("keydown", action_clavier_vues)
|
|
|
|
}
|
|
|
|
|
|
|
|
function init_clavier_analyse(){
|
|
|
|
document.addEventListener("keydown", action_clavier_analyse)
|
|
|
|
}
|