Skip to main content
Post Reopened by DMGregory
This is not a duplicate question, the question is asked with respect to a game framework named Libgdx.
Link

Detecting key press only once in Libgdx

Post Closed as "Duplicate" by aaaaaaaaaaaa, Seth Battin, House
deleted 40 characters in body; edited tags; edited title
Source Link
House
  • 73.3k
  • 17
  • 185
  • 273

Getting Input from Keyboard in LibGdx Detecting key press only once

Have a question on LIBGDX keyboard inputs. Currently I am using this method to read my input, Gdx.input.isKeyPressed(Input.Keys.A)Gdx.input.isKeyPressed(Input.Keys.A), it is working fine tho. But I do realisedrealized at times there are multiple instances of A being pressed when iI only press once. And iI understand that the method had to be placed in the render()render() method for it to work. Is the problem due to the refreshing?

My question is, how can I only detect 1 instance of "A", when A is pressed for once.

Much Thanks for the help :)

Getting Input from Keyboard in LibGdx

Have a question on LIBGDX keyboard inputs. Currently I am using this method to read my input, Gdx.input.isKeyPressed(Input.Keys.A), it is working fine tho. But I do realised at times there are multiple instances of A being pressed when i only press once. And i understand that the method had to be placed in the render() method for it to work. Is the problem due to the refreshing?

My question is, how can I only detect 1 instance of "A", when A is pressed for once.

Much Thanks for the help :)

Detecting key press only once

Have a question on keyboard inputs. Currently I am using this method to read my input, Gdx.input.isKeyPressed(Input.Keys.A), it is working fine. But I do realized at times there are multiple instances of A being pressed when I only press once. And I understand that the method had to be placed in the render() method for it to work. Is the problem due to the refreshing?

My question is, how can I only detect 1 instance of "A", when A is pressed for once.

Source Link
leDon
  • 1
  • 1
  • 1

Getting Input from Keyboard in LibGdx

Have a question on LIBGDX keyboard inputs. Currently I am using this method to read my input, Gdx.input.isKeyPressed(Input.Keys.A), it is working fine tho. But I do realised at times there are multiple instances of A being pressed when i only press once. And i understand that the method had to be placed in the render() method for it to work. Is the problem due to the refreshing?

My question is, how can I only detect 1 instance of "A", when A is pressed for once.

Much Thanks for the help :)