Posts: 2,404
Threads: 153
Joined: Jan 2005
Say, why doesn't the following commands seem to work in FB??
Code:
press$ = INKEY$
IF press$ = CHR$(0) + "H" THEN
IF press$ = CHR$(0) + "P" THEN
..ect..
I've even tried using the ASCII for H, P, M, & K,.. but I always get a error or doesn't work.. Any help?? :???:
Kevin (
x.t.r.GRAPHICS)
Posts: 489
Threads: 34
Joined: Jan 2005
use chr$(255), not chr$(0). i think this is because chr$(0) is used as a end character for strings in linux.
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Posts: 1,439
Threads: 15
Joined: Apr 2003
It's because the NULL term char is used with C (not Linux), and the FB runtime library mostly just calls C runtime routines for string manipulation.
Posts: 2,404
Threads: 153
Joined: Jan 2005
Right,. I'll try that. :wink: , Thanks...
Kevin (
x.t.r.GRAPHICS)
Posts: 2,404
Threads: 153
Joined: Jan 2005
Yep, that's all it needed, thanks.
:wink:
Kevin (
x.t.r.GRAPHICS)
Posts: 46
Threads: 18
Joined: Jan 2005
if you use multikey in you code the following code is your arrow keys as copied from gfxlib
Code:
IF MULTIKEY(&h4B) AND x > 0 THEN x = x - 1
IF MULTIKEY(&h4D) AND x < 639 THEN x = x + 1
IF MULTIKEY(&h48) AND y > 0 THEN y = y - 1
IF MULTIKEY(&h50) AND y < 479 THEN y = y + 1
you can obviously change the end result to what you need but this is what your looking for
o live is to die, to die is to expel, to expel is to exist is to live without knowing to be
Posts: 2,404
Threads: 153
Joined: Jan 2005
Hay, thats cool,.. does it do as it seems, more than 1 keypress at a time is regestered? so no jamming?
Kevin (
x.t.r.GRAPHICS)
Posts: 46
Threads: 18
Joined: Jan 2005
nope no jamming the codes look specifically for the arrow keys only but on multiple keypress the routine so to speak is quicker than the key press so it can register and translate each code before becoming "jammed"
o live is to die, to die is to expel, to expel is to exist is to live without knowing to be
Posts: 2,404
Threads: 153
Joined: Jan 2005
, Thats sweet!!, I'll have to remamber that next time!! :wink:
Kevin (
x.t.r.GRAPHICS)