Only caps?
I''ve written a function to return a key if it is pressed:
[source]
int ReturnKey()
{
for (int i = 0; i < 127; i++)
{
if (!keys && pressedKeys)
{
pressedKeys = false;
}
}
for (int j = 0; j < 127; j++)
{
if (keys[j] && !pressedKeys[j])
{
pressedKeys[j] = true;
return j;
}
}
return -1;
}
[\source]
The one problem is, it ALWAYS return uppercase values. Is there any easier way to get user input from the keyboard? I am using it in a console, and am trying to get user input. Any suggestions?
Thanks
-+=SkyFire360
</i>
i guess you can use "getchar" or "getc". or check the status of the "shift" key if your are using DOS.
Nope, this is using the NEHE base code. All I want is when someone hits the ''g'' key or the ''k'' key or any other key, I want the console to say "gk" or whatever. It is coming out "GK". Are there any good input routines?
-S`kyFire360
-S`kyFire360
If in the ''WndProc'' function you add ''WM_CHAR'' and do your keyboard capture there, it will be case sensitive.
Take Care,
Nyko
Take Care,
Nyko
I think you can use VK_SHIFT to check if the shift key is pressed. It won''t work for Caps Lock, though.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement