Skip to main content
gamedev.net
🔒 Locked

keyboard input error

Started by aphelix Jul 12, 2006 at 3:48 AM 0 replies 350+ views
Original Post
aphelix
aphelix
Hi! I created a basic input system (of direct input) for getting user input in every GameMain(for my small space game).One of the input is fire of laser.But fire continue in spite of stopped shotting.Why input info is remain to following gameloops.? int GameMain(void *parms) { ..... memset(keys, 0 ,256); // input from keyboard if (FAILED(IO_KeyboardDevice->GetDeviceState(sizeof(UCHAR[256]), (LPVOID)keys))) return false; if (keys[DIK_N] & 0x80) Cam->Forward(2.0f); if (keys[DIK_Q] & 0x80){ ParticleAttribute attribute; Gun->SetSize(0.3f); Gun->PrepareParticle(&attribute); Gun->AddParticle(&attribute); }

Topic Locked

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

Sign in to reply to this topic.