Original Post
hi,
i''m coding in C++ and plain WinAPI.
my problem is that when i press a key, it gives me the key-message all the time.
for example im using "w" to switch between wireframe mode and normal polygon mode.
but when i press w the function gets called all the time while w is down. and also if its only hit shortly the function gets called about 100 times.
the second problem is, that im having a windows-dialog above my openGL window. and when this dialog is active all the keys dont work anymore.
here is my code:
while(!done) {
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
if (msg.message==WM_QUIT) {
done=TRUE;
} else {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
} else {
if (active) {
if (keys[''R'']) {
H.create();
H.iterate(it);
}
if (keys[''W'']) {
wireframe=!wireframe;
} else {
DrawGLScene();
SwapBuffers(hDC);
}
}
}
}
www.embege.com