Skip to main content
gamedev.net
🔒 Locked

error using directInput KEYDOWN

Started by bigbrother2000 4 replies 600+ views
Original Post
bigbrother2000
bigbrother2000
I'm trying to use direct input, i think i have initialised everything correctly, however i get one error message, "errorC3861: 'KEYDOWN' identifiernot found, even with argument-dependant lookup" is there something simple i am missing or is it because direct input is not set up correctly, section of code below: void CGame::ProcessKeyboard() { char KeyboardState[256]; if(FAILED(m_pKeyboard->GetDeviceState(sizeof(KeyboardState),(LPVOID)&KeyboardState))) { return; } if(KEYDOWN(KeyboardState, DIK_RIGHT)) { objCamera.Rotate_Around_Point(objCamera.mView, 0, CAMERASPEED, 0); }
circlesoft
circlesoft
KEYDOWN is not a function declared by DInput - it's a macro that's used by the sample framework. It's defined by using the following pre-processor statement:

#define KEYDOWN(name, key) ( name[key] & 0x80 )
bigbrother2000
bigbrother2000
Using this method does anyone know what statement would be required to check for a keyboard number or character e.g. 0 -10 or A-Z, thank you
lack o comments
lack o comments
As far as I remeber ( I've been using a wrapper for a year now =) They are just DIK_x where 'x' is the letter or number.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.