Er, personally I do something like...
do
`MAIN LOOP THINGS
if scancode() then returnVal = myKeystateFunction()
`ADJUSTMENTS FOR USER INPUT
loop
function myKeystateFunction() `not meant to be logical, complete or even functional code
if keystate(alt) then alt=1
if keystate(ctrl) then crtl=1
if keystate(shift) then shift=1
if keystate(x) then returnVal = do(x,alt,crtl,shift) : exitfunction returnVal
if keystate(y) then returnVal = do(y,alt,crtl,shift) : exitfunction returnVal
if keystate(z) then returnVal = do(z,alt,crtl,shift) : exitfunction returnVal
endfunction defaultVal
The reason I brought it up, was that there doesn't appear
to be a significant way of polling all keys without a
brute force approach. I certainly don't need to poll all keys,
but if I or someone else did, I thought it might be helpful
to bring it up. Discuss different schools of thought. In my
snippet you can press any of the three modifier keys, and
one other key. But you could never press x&y and get a result
other than x. And if I did want to poll all the keys, we're
talking about over 100 brute force IF-statements. And if
I were nutz and planned on making any key combination available
then I'd be setting 3 of 100 flags, and then need to test
100+^3 combinations, and the game would be SPF not FPS.
Obviously such an approach is ludicrous, so either veteren
programmers have developed a better way, or have limited
their approach. I have no idea what I am expecting. I suppose
I was expecting a conversation about the approach, or helpful
tidbits... Which I got and I am thankful for. ( THANKS )
However, I didn't mean for the topic to be a specific request
for help with my code. More or less I was looking for a general
discussion about approch. I suppose I failed to phrase it that
way. Quickly review my original topic, I was also curious, about
any undocumented features I was missing about the scancode()
function. Lets face it, it would be nice to poll a core function
and get a array/list of keys currently pressed. Something to
the tune of:
key1 = scancode(0)
key2 = scancode(1)
key3 = scancode(2)
Of course thats assuming a core function would be faster than
a user made function.
============ : Windows 200 SP4+, 3.2GHz Hyperthreaded
-Dejunai ............: 2GB RAM, nVidia 6600 256MB AGP 8x
============ : AC'97 basic A-Bit Motherboard Audio ( drivers always Maintained )