I have just implemented a console in my game engine. The problem I am having is that whenever I type a 'p' in the console the program switches from fullscreen mode. The trigger for fullscreen mode is F1, so it is quite confisg. This is how it is setup:
This is the fullscreen code:
while(!done)
{
...blah blah...
if (keys[VK_F1]) // Is F1 Being Pressed?
{
keys[VK_F1]=FALSE;
KillGLWindow();
fullscreen=!fullscreen;
if (!CreateGLWindow("Luckybob's Demo",640,480,16,fullscreen))
{return 0;}
}
}
this is how the console gets key pressed info:
case WM_CHAR:
{
if(console.is_open)
console.keyPress(wParam);
}
case WM_KEYDOWN:
{
keys[wParam] = TRUE;
if(console.is_open)
console.translateKey(wParam, true);
return 0;
}
case WM_KEYUP: {
keys[wParam] = FALSE;
if(console.is_open)
console.translateKey(wParam, false);
return 0;
}
Nothing in the console code refers to the fullscreen mode during parsing. If I comment out the F1 key, it doesn't happen.
Any clues?
Thanks,
dimebag