linux keydown behaving differently to windows

BlitzMax Forums/BlitzMax Bug Reports/linux keydown behaving differently to windows

Graphics 640,480

Repeat
o=320
p=240
For i#=0 To 360
f#=Sin(i)*128
s=Sgn(Cos(i))
For x#=0 To 8 Step .04
b#=(x^2)-64
a#=((8-x)^2)-64
For e=a To -a
c#=Rnd(e+f+(b*(b*0.01)))*8
SetColor 64-c,c,c
Plot o+e*s,p+b
Plot o+e*s,p-b
Next
Next
Flip
Next
Until KeyDown(1)

someone sent me this code (it used to be on one line as part of the 250 byte source challenge (dare you!) )

anyhow in windows escape quits

on my Ubuntu box it doesnt i tried KEY_ESCAPE too

oddly this works
Graphics 320,240
Repeat
SetClsColor 50,50,50
Cls
For x = 0 To 320-1 Step 4
For y = 0 To 240-1 Step 4
SetColor Rand(250),255,255
Plot Rand(320),Rand(240)
Next
Next
Flip
If KeyHit(KEY_ESCAPE) Exit
Forever

that is some nifty mathematics.
(I had to indent to find the loops :) )
EDIT: come to think of it, maybe key 27 is not Escape in ubuntu

try this in Ubuntu.
Graphics 640,480

Repeat
o=320
p=240
	For i#=0 To 360
		f#=Sin(i)*128
		s#=Sgn(Cos(i))
			For x#=0 To 8 Step .04
				b#=(x^2)-64
				a#=((8-x)^2)-64
					For e=a To -a
						c#=Rnd(e+f+(b*(b*0.01)))*8
						SetColor 64-c,c,c
						Plot o+e*s,p+b
						Plot o+e*s,p-b
						If KeyDown(KEY_ESCAPE) Then End
					Next
			Next
		Flip
	Next
	
forever



Escape doesn't quit the program for me on XP either.

there actually is a little bug in the original post, but it does highlight that key behavior is different in winxp and ubuntu

aparently in winxp it is possible to quit
in ubuntu you cant seem to...

I'm thinking you'd need two machines together as running one OS in a VM to compare will lead to misleading results


that is some nifty mathematics.



Thanks :P

In the original post, 1 should be 27- and if you hit escape, it finishes 1 cycle before ending- but apparently this is still a problem?

This would mean the event que isn't working as expected, or is getting cleared...