2023-03-07 10:22:43 +01:00
|
|
|
////////////////////////////////////////
|
|
|
|
////////////////////////////////////////
|
|
|
|
// CLAVIER
|
|
|
|
|
2023-03-22 09:51:30 +01:00
|
|
|
function action_clavier_avertissement(event){
|
|
|
|
switch (event.key){
|
|
|
|
case 'Enter':
|
|
|
|
if (num_avertissement < ((avertissements_page_1.length))-1){
|
|
|
|
action_bouton_suivant_avertissement()}
|
|
|
|
else{
|
|
|
|
action_bouton_commencer_avertissement()
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'Backspace':
|
|
|
|
if (num_avertissement>0){
|
|
|
|
action_bouton_avant_avertissement()}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-07 10:22:43 +01:00
|
|
|
function action_clavier_contexte(event){
|
|
|
|
switch (event.key){
|
2023-03-11 22:07:08 +01:00
|
|
|
case 'Enter':
|
2023-03-14 11:20:00 +01:00
|
|
|
if (num_texte < ((textes_page_1.length + textes_page_2.length + textes_page_3.length +textes_page_4.length))-2){
|
2023-03-11 22:07:08 +01:00
|
|
|
action_bouton_suivant_contexte()}
|
|
|
|
else{
|
|
|
|
action_bouton_commencer_contexte()
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'Backspace':
|
2023-03-22 10:42:08 +01:00
|
|
|
if (num_texte==0){
|
|
|
|
action_revenir_page_avant_contexte()
|
|
|
|
}
|
2023-03-11 22:07:08 +01:00
|
|
|
if (num_texte>0){
|
|
|
|
action_bouton_avant_contexte()}
|
|
|
|
break;
|
2023-03-07 10:22:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-18 20:26:13 +01:00
|
|
|
|
2023-03-07 10:22:43 +01:00
|
|
|
function action_clavier_analyse(event){
|
|
|
|
switch (event.key){
|
|
|
|
// selectionner pose
|
|
|
|
// valider
|
|
|
|
case 'Enter':
|
|
|
|
action_bouton_valider_analyse()
|
|
|
|
break;
|
2023-03-18 20:26:13 +01:00
|
|
|
// 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;
|
2023-03-07 10:22:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-22 09:51:30 +01:00
|
|
|
function init_clavier_avertissement(){
|
|
|
|
document.addEventListener("keydown", action_clavier_avertissement)
|
|
|
|
}
|
|
|
|
|
2023-03-07 10:22:43 +01:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2023-03-18 20:26:13 +01:00
|
|
|
function init_clavier_explication_analyse(){
|
|
|
|
document.addEventListener("keydown", action_clavier_explication_analyse)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-03-07 10:22:43 +01:00
|
|
|
function init_clavier_analyse(){
|
|
|
|
document.addEventListener("keydown", action_clavier_analyse)
|
|
|
|
}
|