changement nom fonctions + fonctions clavier
This commit is contained in:
parent
58fb282be5
commit
a46cc97deb
|
@ -29,13 +29,14 @@
|
|||
<script src="/static/OBJLoader2.js"></script>
|
||||
<script src="/static/OrbitControls.js"></script>
|
||||
<script src="/static/fonctions_utiles.js"></script>
|
||||
<script src="/static/fonctions_clavier.js"></script>
|
||||
<script src="/static/fonctions_contexte.js"></script>
|
||||
<script src="/static/fonctions_choix_vues.js"></script>
|
||||
<script src="/static/fonctions_inscription.js"></script>
|
||||
<script src="/static/fonctions_explications.js"></script>
|
||||
<script src="/static/fonctions_analyse.js"></script>
|
||||
<script src="/static/fonctions_fin.js"></script>
|
||||
<script src="/static/interface3D.js"></script>
|
||||
<script src="/static/MAIN.js"></script>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// MAIN
|
||||
// initialisation des variables
|
||||
init_variable(true)
|
||||
// initialisation du canvas : load des images
|
||||
//setUp_3D(indice_mesh)
|
||||
|
||||
canvas = document.getElementById("canvas")
|
||||
canvas.width = window.innerWidth;
|
||||
|
@ -12,7 +10,6 @@ canvas.height = window.innerHeight;
|
|||
ctx = canvas.getContext("2d")
|
||||
|
||||
init_data()
|
||||
//init_clavier()
|
||||
// action
|
||||
animate()
|
||||
|
||||
|
@ -225,120 +222,6 @@ function setUp_3D(idx_mesh, idx_i_init, idx_j_init){
|
|||
interactions.push({"time": new Date().getTime(), "type": "Affichage Mesh random : "+mesh_courant+" en theta, delta : ("+theta_init+", "+delta_init+")"})
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
// CLAVIER
|
||||
|
||||
function action_clavier_contexte(event){
|
||||
switch (event.key){
|
||||
// selectionner pose
|
||||
case ' ' :
|
||||
action_bouton_commencer_contexte('clavier')
|
||||
break;
|
||||
// valider
|
||||
case 'Enter':
|
||||
action_bouton_commencer_contexte('clavier')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function action_clavier_inscription(event){
|
||||
switch (event.key){
|
||||
// selectionner pose
|
||||
case ' ' :
|
||||
if (champs_remplis_correctment()){
|
||||
action_bouton_commencer('clavier')}
|
||||
break;
|
||||
// valider
|
||||
case 'Enter':
|
||||
if (champs_remplis_correctment()){
|
||||
action_bouton_commencer('clavier')}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function action_clavier_vues(event){
|
||||
switch (event.key){
|
||||
case 'ArrowLeft':
|
||||
console.log("deplacement K-G")
|
||||
action_fleche_gauche()
|
||||
//idx_i = (idx_i+1)%8
|
||||
break;
|
||||
case 'ArrowRight' :
|
||||
console.log("deplacement K-D")
|
||||
action_fleche_droite()
|
||||
//idx_i = (idx_i+7)%8
|
||||
break;
|
||||
case 'ArrowDown' :
|
||||
console.log("deplacement K-B")
|
||||
action_fleche_bas()
|
||||
//idx_j = Math.min(idx_j+1,4)
|
||||
break;
|
||||
case 'ArrowUp' :
|
||||
console.log("deplacement K-H")
|
||||
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)
|
||||
}
|
||||
|
||||
function init_clavier_vues(){
|
||||
document.addEventListener("keydown", action_clavier_vues)
|
||||
}
|
||||
|
||||
function init_clavier_analyse(){
|
||||
document.addEventListener("keydown", action_clavier_analyse)
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
// CLAVIER
|
||||
|
||||
function action_clavier_contexte(event){
|
||||
switch (event.key){
|
||||
// selectionner pose
|
||||
case ' ' :
|
||||
action_bouton_commencer_contexte('clavier')
|
||||
break;
|
||||
// valider
|
||||
case 'Enter':
|
||||
action_bouton_commencer_contexte('clavier')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function action_clavier_inscription(event){
|
||||
switch (event.key){
|
||||
// selectionner pose
|
||||
case ' ' :
|
||||
if (champs_remplis_correctment()){
|
||||
action_bouton_commencer('clavier')}
|
||||
break;
|
||||
// valider
|
||||
case 'Enter':
|
||||
if (champs_remplis_correctment()){
|
||||
action_bouton_commencer('clavier')}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function action_clavier_vues(event){
|
||||
switch (event.key){
|
||||
case 'ArrowLeft':
|
||||
console.log("deplacement K-G")
|
||||
action_fleche_gauche()
|
||||
//idx_i = (idx_i+1)%8
|
||||
break;
|
||||
case 'ArrowRight' :
|
||||
console.log("deplacement K-D")
|
||||
action_fleche_droite()
|
||||
//idx_i = (idx_i+7)%8
|
||||
break;
|
||||
case 'ArrowDown' :
|
||||
console.log("deplacement K-B")
|
||||
action_fleche_bas()
|
||||
//idx_j = Math.min(idx_j+1,4)
|
||||
break;
|
||||
case 'ArrowUp' :
|
||||
console.log("deplacement K-H")
|
||||
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)
|
||||
}
|
||||
|
||||
function init_clavier_vues(){
|
||||
document.addEventListener("keydown", action_clavier_vues)
|
||||
}
|
||||
|
||||
function init_clavier_analyse(){
|
||||
document.addEventListener("keydown", action_clavier_analyse)
|
||||
}
|
Loading…
Reference in New Issue