Archived

This topic is now archived and is closed to further replies.

Cibressus

How to use non-special keys in Latest BaseCode?

Recommended Posts

Cibressus    100
can some one post a example of a regular keyboard carcter (abcdefghijlmnopqrstuvwxy and or z) being used with the keys function in the lastest base code? i can only get special keys working (VK_F1, VK_UP, ect.)

Share this post


Link to post
Share on other sites
JohnyB    122
You usually just enclose the character you want to use with a single quote so you get the character code, for example...

if(key['A']) //65
//...


[edited by - JohnyB on March 28, 2004 2:55:25 AM]

Share this post


Link to post
Share on other sites
Cibressus    100
well, here

this code DOES work

if(g_keys->keyDown[VK_UP] == TRUE)
{
Camera.MoveCamera(0.02f);
}

this code DOES NOT work

if(g_keys->keyDown[''w''] == TRUE)
{
Camera.MoveCamera(0.02f);
}

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
the letter needs to capatalized. if the letter is a capital it should work

Share this post


Link to post
Share on other sites