How to clear the keyboard buffer?
Just as the title says,
how to clear the keyboard buffer with C/ASM?
please help
thanx
creativity is the key:)
fflush is defined only for output streams. You''ll need to use a system-dependant function to clear an input buffer.
it works for input streams too, but i used that when i was doing dos programming. i''m pretty sure it''s won''t work for win applications
----------------
- Pouya / FOO!!!
***CENSORED***
----------------
- Pouya / FOO!!!
***CENSORED***
It depends on how you're getting the keyboard buffer
I suspect that bit banging the keyboard interraupt will piss off windows.
or just get everything from the buffer & throw it away
Edited by - Magmai Kai Holmlor on July 11, 2000 11:40:51 PM
I suspect that bit banging the keyboard interraupt will piss off windows.
or just get everything from the buffer & throw it away
Edited by - Magmai Kai Holmlor on July 11, 2000 11:40:51 PM
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Ditto, here is what I use...
Ripped off from genesis...
void InitializeInputDevices(void){ int32 i; // Do a test call on all the key combos, to reset them for (i=0; i<256; i++) { NewKeyDown(i, Graphics.hWnd); IsKeyDown(i, Graphics.hWnd); }}geBoolean IsKeyDown(int KeyCode, HWND hWnd){ if (GetFocus() == hWnd) if (GetAsyncKeyState(KeyCode) & 0x8000) return GE_TRUE; return GE_FALSE;}//=====================================================================================// NewKeyDown//=====================================================================================geBoolean NewKeyDown(int KeyCode, HWND hWnd){ if (GetFocus() == hWnd) if (GetAsyncKeyState(KeyCode) & 1) return GE_TRUE; return GE_FALSE;}
Ripped off from genesis...
Chris Brodie
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement