Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Event KeyPressed and KeyReleased on KeyPress [Solved]  (Read 4041 times)

0 Members and 1 Guest are viewing this topic.

Gobbles

  • Full Member
  • ***
  • Posts: 132
    • View Profile
    • Email
Event KeyPressed and KeyReleased on KeyPress [Solved]
« 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:


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!
« Last Edit: August 26, 2014, 03:47:36 am by Gobbles »

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Event KeyPressed and KeyReleased on KeyPress
« Reply #1 on: August 26, 2014, 03:40:54 am »
You need to put break in your switch. :P
Back to C++ gamedev with SFML in May 2023

Gobbles

  • Full Member
  • ***
  • Posts: 132
    • View Profile
    • Email
Re: Event KeyPressed and KeyReleased on KeyPress
« Reply #2 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)

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Event KeyPressed and KeyReleased on KeyPress [Solved]
« Reply #3 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.

Gobbles

  • Full Member
  • ***
  • Posts: 132
    • View Profile
    • Email
Re: Event KeyPressed and KeyReleased on KeyPress [Solved]
« Reply #4 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.

 

anything