Yep you can use dbKeyState() to get if any key on the keyboard is pressed or not. You can manually go get the scan codes, but that takes a while and some memorization.
The better and easier way of getting key scan codes is to include "dinput.h" in your program.
This will allow you to use predefined numbers like this:
if(dbKeyState(DIK_W)) { // W key pressed
}
Instead of:
if(dbKeyState(18)) { // W key pressed
}
It's a lot easier to read and understand. Keys like the space bar would be something like DIK_SPACE and the right shift would be DIK_RSHIFT etc. Look into the header file toward the end for all of the definitions.
#ifdef _DEBUG
FixBugs(All);
#endif