Thank you guys for all your replies! Now:
Starik1974 - Thanks for the suggestion about the two arrays - but I did not want to have to manually set all that info.
antareus - Thanks for that suggestion as well - but I would have to manually make two sets of 256 custom defines + any others if the user wants a different type of input class. Namespaces will not work well in my case.
hh10k - I agree and that is exactly what I'm trying to do, but I cannot figure out how to make them compatible per se.
birdjames - Thank you for that code! I messed around with it some and it is a 50% solution to my problem. When I use a DIK_ key, I do this:
// just an example// 0x1E = 30 (DIK_A)// dikey = 65int dikey = MapVirtualKeyEx( 0x1E, 1, GetKeyboardLayout(GetCurrentThreadId()) );
This is exactly what I need! As for the VK_ I can use it in a similar way. I took a look at
MSDN to see the specifics of that function. Now that I can freely convert between the keys - DIK_A == 'A' == keys[65] - I just need to solve the other half of the problem - making a set of defines to use them right.
Here is an example:
Right now I have:
if( input->KeyDown( VK_ESCAPE ) ) for W32
in the game loop and
if( input->KeyDown( DIK_ESCAPE ) ) for DI
I would like to just have like:
if( input->KeyDown( ENGINE_ESCAPE ) )
so that no matter wheter they choose W32 or DI, it will be the correct key - in which I would not have to be dependent on the specifc keys. This is so they can change the input plugin at any time during development and it still works as is - they will not need to change anything.
Right now, the best thing I can think of goes along the lines of hh10k, Starik1974, and antareus posts. I know I will have to define my own keys - ENGINE_ESCAPE, etc.. but I', trying to difure out the best way. I can't define them in the header files b/c they are plugins and the header files are not used for the dervived classes, so I was thinking along the lines of maybe using an enum.
Thanks for all the input!
- Drew
[Edited by - Drew_Benton on May 25, 2005 9:45:33 PM]