KEYUP + Shift key

Started by
11 comments, last by JeremyCAFE 17 years, 7 months ago
^^ that is me, login failed.
Advertisement
Quote:Original post by Anonymous Poster
I was trying to mock the way every text editor works with holding a key down. I noticed it pauses for a second, and then continues to spam. To do this I set a flag that the key was down and when it was pressed. I only spam the key when it has been down for longer than .5 seconds. I am 100% sure this is a poor way of doing it. I just couldn't think of any other way.

Can't you request the OS to send you repeat keydown events? This is how it is done on a Mac, and it gives you the users keyboard repeat rate settings too (sorry, not familiar with the Windows API).

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

[edit] After checking to see what happens if I just add to the input string straight out of wm_char I noticed it does in fact implement the pause. Thank you everyone for the help.

This topic is closed to new replies.

Advertisement