SFML community forums

Help => Window => Topic started by: Gobbles on August 26, 2014, 03:29:59 am

Title: Event KeyPressed and KeyReleased on KeyPress [Solved]
Post by: Gobbles on August 26, 2014, 03:29:59 am
Hey guys, wondering if you guys could help me test something real quick. With the following code whenever I issue a keyboard keyPress, the key fires off both a key press and a key release:

(click to show/hide)

You can view my test results here:
(http://i.imgur.com/6wQTZnV.png)

Just the output from the code above, as you can see, every keypress fires off a KeyPressed and a keyReleased

This is keyboard only as joystick works fine.

currently on commit: d73418261b5aed44861ea66faaa4ef3d2589fc6a (exploiters nightly, visual studio 2012 32 bit June 20th 2014)

Any info would be greatly appreciated. Thanks!
Title: Re: Event KeyPressed and KeyReleased on KeyPress
Post by: FRex on August 26, 2014, 03:40:54 am
You need to put break in your switch. :P
Title: Re: Event KeyPressed and KeyReleased on KeyPress
Post by: Gobbles on August 26, 2014, 03:47:15 am
Holy... crap. Well that's what I get for over analyzing. Thanks for the quick reply! I knew it had to be something relatively stupid (I might be burning the candle at both ends)
Title: Re: Event KeyPressed and KeyReleased on KeyPress [Solved]
Post by: Ixrec on August 26, 2014, 08:11:58 am
Tip for the future: Always try a debugger for "simple" problems like this.  You probably would've noticed the problem as soon as you stepped through that switch statement.
Title: Re: Event KeyPressed and KeyReleased on KeyPress [Solved]
Post by: Gobbles on August 26, 2014, 12:34:43 pm
I always use a debugger, I stepped through the code, but for some reason my brain didn't pick it up. Sometimes you just need the second pair of eyes I guess.