Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

ThinkPad TrackPoint mouse as Joystick for Flight Model Simul


  • Please log in to reply
1 reply to this topic
jhonyl
  • Guests
  • Last active:
  • Joined: --
ThinkPad TrackPoint mouse as Joystick for Flight Model Simulator (FMS). You could use it for other things too. You would need to change the Flying in 'ifWinActive, Flying' and the F,D on the Send command to the correct keys for you.

How it works? -
You press caps lock in the FMS window, and then you use the mouse as a joystick. To exit you need to press the capsLock again but keep it pressed until it is recognized, it takes a second or two press for me.

~CapsLock::
SetTitleMatchMode, 2
ifWinActive, Flying
{
CoordMode, Mouse , Screen
XSum:=0
YSum:=0
XThreshOld:=0
YThreshOld:=0
MouseGetPos, OldX, OldY, WinID
MouseGetPos, X, Y, WinID
Loop
{
	MouseGetPos, X, Y, WinID
	XSum:= XSum + X - OldX
	YSum:= YSum + Y - OldY
		
	if (XSum > XThreshOld and not NotepadApp)
	{
		Send {D up}
		Send {F down}
		XSum:= 0
	}
	else if (XSum < -XThreshOld)
	{
		Send {F up}
		Send {D down}
		XSum:= 0
	}	
	else
	{
		Send {F up}
		Send {D up}	
	}
	if ( -YSum > YThreshOld )
	{
		Send {NumpadDown up}
		Send {NumpadUp down}
		YSum:= 0
	}
	else if ( -YSum < -YThreshOld )
	{
		Send {NumpadUp up}
		Send, {NumpadDown down}
		YSum:= 0
	}
	else
	{
		Send {NumpadDown up}
		Send {NumpadUp up}
	}
	MouseMove, %OldX%, %OldY%
	GetKeyState, state, CapsLock, T 
	if (state = "U")
	 	break
	
	sleep, 100
}


steveT43
  • Guests
  • Last active:
  • Joined: --
Thanks for trying, but the script won't run. This one seems to be missing a } somewhere.