.isKeyPressed Issue (I think)

Man was xsvenson right or what. I didn’t realize there are so many different approaches to solve this issue, and I am sure there are more then what was presented here.

Thank you SHC for you input and idea, looks like I have some work to do :slight_smile:

I will be taking all these ideas and working them in this upcoming week, once I have found the solution I will report back to show you guys.

Here is the solution I have come up with so far that actually works flawlessly. What do you think?

if(userInput.isKeyPressed(Input.KEY_ENTER)){
			userInput.clearKeyPressedRecord();
		}

I also added it to every nonessential if statement that just progresses the story line but doesn’t contribute to data collection. I did a test where a variable is updated dependent on the user input and it worked while still not blocking or skipping the progression of the story line.

//Description One update
		if(userInput.isKeyPressed(Input.KEY_Q)){
			userInput.clearKeyPressedRecord();
			twoDescription = false;
			threeDescription = false;
			oneDescription = true;
		}
		if(oneDescription == true){
			if(userInput.isKeyPressed(Input.KEY_BACK)){
				oneDescription = false;
			}
		}
		
		//Description Two update
		if(userInput.isKeyPressed(Input.KEY_W)){
			userInput.clearKeyPressedRecord();
			oneDescription = false;
			threeDescription = false;
			twoDescription = true;
		}
		if(twoDescription == true){
			if(userInput.isKeyPressed(Input.KEY_BACK)){
				twoDescription = false;
			}
		}
		
		//Description Three update
		if(userInput.isKeyPressed(Input.KEY_E)){
			userInput.clearKeyPressedRecord();
			oneDescription = false;
			twoDescription = false;
			threeDescription = true;
		}
		if(threeDescription == true){
			if(userInput.isKeyPressed(Input.KEY_BACK)){
				threeDescription = false;
			}
		}

This is a quick fix that allows me to keep most the code I have already written. You all have shown me different approaches and I value them greatly. Thank you for the help guys! :smiley: