Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectInput is not taking input

Started by sakky Dec 19, 2002 at 3:17 PM 1 replies 150+ views
Original Post
sakky
sakky
Every thing runs fine, but DirectInput does not respond to key events. This is what I use in my code
  
#define KEY_DOWN( name, key )			( ( name[key] & 0x80 ) ? true : false )


if ( FAILED( g_pKeyboard->GetDeviceState( sizeof( UCHAR[256] ), ( LPVOID )buffer ) ) )
		g_pKeyboard->Acquire();

	if ( FAILED( g_pMouse->GetDeviceState( sizeof( DIMOUSESTATE ), ( LPVOID )& states ) ) )
		g_pMouse->Acquire();

	if ( KEY_DOWN( buffer, VK_ESCAPE ) )
		PostQuitMessage( 0 );
  
This has worked before, why isn''t it now? I have now errors setup DirectInput for keybaord and mouse input. They just don''t respond. There''s now reason for it not to work!! That I can see any ways.
Take back the internet with the most awsome browser around, FireFox
sakky
sakky
At times I feel like a jackass because I don''t pay enough attention to what I''m doing. VK_ESCAPE should be DIK_ESCAPE, that’s what the problem was.
Take back the internet with the most awsome browser around, FireFox

Topic Locked

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

Sign in to reply to this topic.