Advertisement

hi guys, how do you detect when a key is up using DInput?

Started by February 25, 2002 06:34 AM
6 comments, last by mickey 22 years, 8 months ago
if(KEYDOWN(buffer, DIK_RIGHT)) --> that is to detech when the right arrow key is down, how about when it was released? thanks!!!
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
if(KEYUP(buffer, DIK_RIGHT))

Oli


All the best problems start with C

.:: K o s m o s E n g i n e ::.
Advertisement
I dunno, you could set a BOOL on the Keypress event and then

  if ((blnRightArrowPressed == TRUE) && (KEYDOWN(buffer, DIK_RIGHT) == FALSE)){ // Your code goes here}  




Oli


All the best problems start with C

.:: K o s m o s E n g i n e ::.
yikes! KeyUp won''t work, KeyDown is a macro remember? it''s defined like this...
#define KEYDOWN(name,key) (name[key] & 0x80)


http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
quote: Original post by mickey
yikes! KeyUp won''t work, KeyDown is a macro remember? it''s defined like this...
#define KEYDOWN(name,key) (name[key] & 0x80)




#define KEYUP(name, key) (!(name[key] & 0x80))
hmm.. wait i think there''s soemthing wrong with your code there...
it says, when the right arrow key is pressed AND the right arrow KEYDOWN is FALSE.... uh huh... ?
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
Advertisement
anonymouse poster: eh? that things works? hehe, thanks!
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
ei, that thing didn''t work
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,

This topic is closed to new replies.

Advertisement