Problems with "multifuntcional" keys
in
Programming Questions
•
1 year ago
Hi, My problem is that every time i hit the "1" key both action starts.But only the actuall activ should. How can i fix it without a timer?
void keyReleased(){
if(bomovie1 && ){ //movie1 aktiv
println("movie aktiv");
if(key == '1') { //Startbutton
bostart=true;
bomovie1=false;
mov1.pause();
mov1.goToBeginning();
}
if(key == '2') { //Weiterbutton
borepeat=false;
mov1.goToBeginning();
}
if(key == '3') { //Antwort1button
borichtig1=true;
}
if(key == '4') { //Antwort2button
bofalsch1=true;
}
if(key == '5') { //Antwort3button
bofalsch1=true;
}
}
if(bostart){ //Startscreen aktiv
println("start aktiv");
if(key == '1') { //Startbutton
bostart=false;
bomovie1=true;
mov1.play();
}
}
}
void keyReleased(){
if(bomovie1 && ){ //movie1 aktiv
println("movie aktiv");
if(key == '1') { //Startbutton
bostart=true;
bomovie1=false;
mov1.pause();
mov1.goToBeginning();
}
if(key == '2') { //Weiterbutton
borepeat=false;
mov1.goToBeginning();
}
if(key == '3') { //Antwort1button
borichtig1=true;
}
if(key == '4') { //Antwort2button
bofalsch1=true;
}
if(key == '5') { //Antwort3button
bofalsch1=true;
}
}
if(bostart){ //Startscreen aktiv
println("start aktiv");
if(key == '1') { //Startbutton
bostart=false;
bomovie1=true;
mov1.play();
}
}
}
1