12-10-2004, 11:05 PM
12-11-2004, 01:16 AM
Quote:Marcade Wrote:Can InkeyTest.exe handle the arrow keys?Wow, I don't know what would make to do that... what happens if the first key you press is an arrow key?
For all four keys, it returns CHR$(255) + the CHR value of the previous key for me.
Then the second one just returns a zero
I have Windows XP SP2 on an Athlon desktop.
12-11-2004, 02:45 AM
Quote:Then the second one just returns a zero :(Same here (XP SP2, Athlon XP). Hmm... returns zero as in, Getkey returns zero, or Inkey$ returns "0" or "", or what?
I have Windows XP SP2 on an Athlon desktop.
12-11-2004, 03:08 AM
Quote:Marcade Wrote:Then the second one just returns a zeroSame here (XP SP2, Athlon XP). Hmm... returns zero as in, Getkey returns zero, or Inkey$ returns "0" or "", or what?
I have Windows XP SP2 on an Athlon desktop.
When I start the Inkey program that came in your zipfile and immediately start pressing any of the arrow keys, I get:
CHR$(255) + CHR$(0)
CHR$(255) + CHR$(0)
CHR$(255) + CHR$(0)
CHR$(255) + CHR$(0)
CHR$(255) + CHR$(0)
CHR$(255) + CHR$(0)
CHR$(255) + CHR$(0)
:|
12-11-2004, 04:23 AM
Marcade: What happens when you run this and press keys?
12-11-2004, 04:43 AM
Quote:Marcade: What happens when you run this and press keys?
Then I see a lot of stuff :-)
But the interesting part is, now I do see a difference when pressing keys
The up key: CHR$(255) + CHR$(200) (Scancode: 200; SDLKey: 273)
The down key: CHR$(255) + CHR$(208) (Scancode: 208; SDLKey: 274)
The left key: CHR$(255) + CHR$(203) (Scancode: 203; SDLKey: 276)
The right key: CHR$(255) + CHR$(205) (Scancode: 205; SDLKey: 275)
12-11-2004, 04:48 AM
Darn. I guess this means I can't count on scancodes always being the same on different computers. At least the SDL key code is the same... I'll just have to use that instead. Arg, what a pain. It means a lot more code or a huge lookup table.
Are F1-F12, Insert, Delete, PageUp, PageDown, Home, or End giving stange results too?
EDIT: There was also a bug in InkeyTest.bas, that's why it was showing the last keypress :oops:, it's fixed now, but I'll still have to rewrite my Inkey code.
Are F1-F12, Insert, Delete, PageUp, PageDown, Home, or End giving stange results too?
EDIT: There was also a bug in InkeyTest.bas, that's why it was showing the last keypress :oops:, it's fixed now, but I'll still have to rewrite my Inkey code.
12-11-2004, 04:49 AM
Quote:Darn. I guess this means I can't count on scancodes always being the same on different computers. At least the SDL key code is the same... I'll just have to use that instead. Arg, what a pain. It means a lot more code.
Are F1-F12, Insert, Delete, PageUp, PageDown, Home, or End giving stange results too?
Well I don't know what's 'strange' .. like if they'd be different on another computer. I only know they do give a different results.
Only my arrow keys were doing nothing.
12-11-2004, 04:55 AM
Quote:Only my arrow keys were doing nothing. :)That's a bug in InkeyTest.bas. The next version of the library will have an Inkey that should work on your computer.
By strange I meant different from QB's INKEY$.
12-11-2004, 11:05 AM
eh? i tried a pixel test in fb and qb... screen 13, draw as many pixels as they can. qb used poke, fb used pset.
qb (compiled) 10000+
fb: 400 max
note that fb is also flipping every loop as well... but how come it's running so slowly?
just so you have it, here's my code. Probably some no-no i'm doing wrong. like maybe using timer?
qb (compiled) 10000+
fb: 400 max
note that fb is also flipping every loop as well... but how come it's running so slowly?
just so you have it, here's my code. Probably some no-no i'm doing wrong. like maybe using timer?
Code:
'$include: "qbgfx4fb.bi"
redim fps as string
screen 13
t! = timer
randomize timer
do
fps = str$(count / (timer - t!))
locate 1,1
gfx_Print fps
pset int(rnd * 320), int(rnd * 240), int(rnd * 256)
count = count + 1
flip
loop until len(inkey$)