MouseSpeed

BlitzMax Forums/BlitzMax Beginners Area/MouseSpeed

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi,

Apologies for resurrecting this ancient one, but the example code for keeping the mouse centred is behaving a little strangely here...

It works fine on Win32, but on Mac it seems to give odd results. Can anyone confirm this with the code below please?

With DEPTH set to 16 or 32, no movement at all is detected.
With DEPTH set to 0 (window), the YSpeed flicks between 0 and 1, and XSpeed stays at zero, whichever way the mouse is moved.

Const DEPTH = 32 ' 0

Global MouseXSpeed,MouseYSpeed

Function SampleMouse()
	MouseXSpeed=MouseX()-320
	MouseYSpeed=MouseY()-240
	MoveMouse 320,240
End Function

Graphics 640,480, DEPTH

HideMouse
MoveMouse 320,240

While Not KeyHit(KEY_ESCAPE)
	SampleMouse
	Cls
	DrawText "MouseXSpeed="+MouseXSpeed,0,0
	DrawText "MouseYSpeed="+MouseYSpeed,0,20
	Flip
Wend