Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Delay after Keyboard-Input

$
0
0

@JannoTjarks wrote:

Hi guys,

i am learning MonoGame now since 2 weeks. It is a very nice framework and exactly the thing i was searching all the time for game development. Sorry, if the answer to my question is to easy. :grin:

Actually i am developing a Space-Shooter. My problem is, that MonoGame is checking the keyboard input too fast, so it is reading a klick multiple times. At the following i added the code i used to switch into/out FullScreen.

if (Keyboard.GetState().IsKeyDown(Keys.F12))
{
Graphics.ToggleFullScreen();
}

Is there a option to check pressed button in aquivalent to https://docs.microsoft.com/de-de/dotnet/api/system.windows.forms.control.keypress?view=netframework-4.7.2?
Or should i add a timer to enable a delay.

Thank you very much!

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles