Qbasicnews.com

QbasicNews.Com => Challenges => Topic started by: Deleter on November 28, 2005, 11:29:11 PM



Title: finding multikey scan codes
Post by: Deleter on November 28, 2005, 11:29:11 PM
now I am sure there is a reference somewhere...but I prefer to simply code a tiny program to find the multikey value for any key while im making a program. I shortened it down to 4 lines, I was wondering if there was either any shorter linewise or simpler to look at ways (still same line as this) to do the same thing. It has to exit when you press esc, print the value of the key you are pressing, and check all 127 values. If there aren't any other short ways, then just get creative and show us what you come up with :P.

Code:
screen 18
for bla = 0 to 128
    if multikey(bla) then print bla else bla = iif((bla>127) AND NOT(MULTIKEY(1)),0,bla)        
next


Title: finding multikey scan codes
Post by: DrV on November 29, 2005, 01:15:34 AM
There's a reference in docs/gfxlib.txt and constants in fbgfx.bi, both included with the standard distribution. :)


Title: finding multikey scan codes
Post by: Deleter on November 29, 2005, 01:22:16 AM
does that mean you can just use say "Multikey(SC_ESCAPE)" without including anything, since gfxlib is already included? (And I still like my program anyways =)


Title: finding multikey scan codes
Post by: DrV on November 29, 2005, 01:24:47 AM
It's just a regular include file; you have to #include "fbgfx.bi"