Qbasicnews.com
July 04, 2020, 07:58:57 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Arrow Keys in FB?  (Read 4318 times)
Rattrapmax6
__/--\__
*****
Posts: 2577



WWW
« on: February 06, 2005, 04:18:41 PM »

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??  :Huh:
Logged

Kevin (x.t.r.GRAPHICS)

dumbledore
Ancient Guru
****
Posts: 520



WWW
« Reply #1 on: February 06, 2005, 04:57:26 PM »

use chr$(255), not chr$(0).  i think this is because chr$(0) is used as a  end character for strings in linux.
Logged

ttp://m0n573r.afraid.org/
Quote from: "HexDude"
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
DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #2 on: February 06, 2005, 05:22:45 PM »

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.
Logged
Rattrapmax6
__/--\__
*****
Posts: 2577



WWW
« Reply #3 on: February 06, 2005, 05:51:08 PM »

Right,. I'll try that.  :wink: , Thanks...
Logged

Kevin (x.t.r.GRAPHICS)

Rattrapmax6
__/--\__
*****
Posts: 2577



WWW
« Reply #4 on: February 06, 2005, 07:01:03 PM »

Yep, that's all it needed, thanks.  Cheesy  :wink:
Logged

Kevin (x.t.r.GRAPHICS)

MNDRBNDR
Member
*
Posts: 46



« Reply #5 on: February 09, 2005, 10:34:36 PM »

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
Logged

o live is to die, to die is to expel, to expel is to exist is to live without knowing to be
Rattrapmax6
__/--\__
*****
Posts: 2577



WWW
« Reply #6 on: February 11, 2005, 03:27:29 PM »

Hay, thats cool,.. does it do as it seems, more than 1 keypress at a time is regestered? so no jamming? Smiley
Logged

Kevin (x.t.r.GRAPHICS)

MNDRBNDR
Member
*
Posts: 46



« Reply #7 on: February 13, 2005, 12:08:35 PM »

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"
Logged

o live is to die, to die is to expel, to expel is to exist is to live without knowing to be
Rattrapmax6
__/--\__
*****
Posts: 2577



WWW
« Reply #8 on: February 13, 2005, 12:23:27 PM »

Cheesy , Thats sweet!!, I'll have to remamber that next time!!  :wink:
Logged

Kevin (x.t.r.GRAPHICS)

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!