Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Smart movement key
#1
What i mean by "smart"?
Well, like in all games, where you press an arrow key and the character istantly move, with no delay.

You know, in basic, when you press a key, the characters move, then pause half sec, and then start moving again.

I know is because the input is buffered (i think..) and it can be somewhat tweaked with the dos-command mode con (or another similar... i don't remember)

I want a "true" key reading, where character moves for EXACTLY the time you keep pressed the key, like in all games since pong...

Preferably in pure basic, if possible.

Hope you understood and tanx.
othing to read...
Reply
#2
INP(&H60)
Or: INP(&H64)

Cant remember which one..
Reply
#3
That should work

Code:
CLS
DO
C = INP(&H60)
LOCATE 1, 1
PRINT "Event Code :"; C; " "
IF C1 <> C AND C <= 83 THEN
k$ = INKEY$
LOCATE 2, 1
PRINT "KeyDown:"; C; k$; " "
FOR i = 1000 TO 2000 STEP 100
SOUND (i), .1
NEXT
END IF

IF C <= 83 THEN
r$ = INKEY$
LOCATE 2, 1
PRINT "KeyHold:"; C; k$; " "
END IF

IF C > 83 AND C1 <> C THEN
LOCATE 2, 1
PRINT "KeyUp:"; C - 128; k$; " "
FOR i = 2000 TO 1000 STEP -100
SOUND (i), .1
NEXT
END IF
C1 = C
LOOP UNTIL k$ = CHR$(27)
url=http://zerodivide.h15.ru/cyclone.html]Cyclone v2.5.2 GUI For QBasic 4.5/7.1[/url]
Explorer For DOS
Reply
#4
i thought it was
[syntax="qbasic"]keycode% = INP(&H90)[/syntax]
Reply
#5
nah its &h 60

or

96 decimal
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)