Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8922627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:53:23+00:00 2026-06-15T06:53:23+00:00

I am doing a little game with sprites where the character moves depending on

  • 0

I am doing a little game with sprites where the character moves depending on the pressed key (arrows). I’ve noticed that the .KeyDown() method keeps being called until any key is released.

e.g. When the user is pressing the up arrow, the method of .KeyDown() keeps being called. If the down arrow is pressed, still with the up arrow pressed, the KeyEventArgs receives now the input from the down arrow. Finally, when the up arrow is released, the .KeyDown()event stops being called even though the down arrow is still pressed.

How do I “reset” the input and tell the compiler to keep calling .KeyDown()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:53:25+00:00Added an answer on June 15, 2026 at 6:53 am

    A very good question- I don’t believe that there’s any way to override this default behavior, but it would certainly be possible to avoid this effect by keeping track of key presses yourself- i.e., when .KeyDown() is called, add the key to some type of structure which keeps track of it- and then, when .KeyUp() is called, remove the key from that structure.

    Then, just repeatedly check that structure for the currently pressed keys, and base your movement off of that, not what .KeyDown() is telling you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a map editor for a little game project that I'm doing. Considering
I'm doing a little game, using KineticJS. For the animation of the character movement,
I'm doing a little game in C++ and I'm discovering the class members function
I'm doing a little game in Python 3.2 with use of PyQt. I needed
I have a trivial little game I wrote in javascript that creates a wave
I am creating a little game client that will end up connecting to a
I'm trying to write up a little game that consists of a U.F.O. that
I'm trying to make a little game that will first show the player a
I'm creating a game with points for doing little things, so I have a
I have a silly little game that I made just for myself, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.