|
Post by u9 on Apr 30, 2007 5:35:28 GMT -5
Code 1
graphics.initialize mouse.initialize system.pause 1000 running = True Do While running system.debugPrint mouse.x mouse.update running = mouse.leftButton system.pause 200 Loop
mouse.terminate graphics.terminate
Code 2
graphics.initialize mouse.initialize system.pause 1000 running = True Do While running system.debugPrint mouse.x mouse.update running = not mouse.leftButton system.pause 200 Loop
mouse.terminate graphics.terminate
With code 1 i can keep the program running by holding the mouse button. With code 2 i cannot stop the program by pressing the mouse button. How come? It seems like a bug to me or is there something i am missing?
|
|
|
Post by Guilect on Apr 30, 2007 6:26:22 GMT -5
Well it is not a boolean that is being returned. It is a value and when you NOT it it turns into someother value.
You want it boolean, I\'ll make it boolean..
|
|
|
Post by u9 on Apr 30, 2007 7:55:38 GMT -5
Ah, yeah i see that the values returned by the leftbutton etc. are 128. This is maybe something that comes from directx? Anyway, i found a solution by casting the value to boolean:
result = not cBool( mouse.leftButton )
I can imagine that maybe the value is 128 in case one used some kind of touch sensitive input device. Of course i don't think brutus will support such a device so maybe it is best to make the values boolean (this is what the documentation says).
Any thoughts?
|
|
|
Post by Guilect on Apr 30, 2007 17:42:56 GMT -5
made to be boolean in v1.8
|
|