188 lines
6.4 KiB
Text
188 lines
6.4 KiB
Text
// Click the RUN Button above -^ to start,
|
|
// The mice must be plugged in before pressing RUN.
|
|
|
|
// Don't click the title bar of THIS window with the REAL mouse or it
|
|
// will freeze! This includes when it is minimized to the desktop.
|
|
// You can click title bars of other windows with the real mouse, and
|
|
// you can click this window's title bar with any fake mouse.
|
|
// If it freezes, use Alt+Tab to fix it.
|
|
|
|
// The mice will move slowly over GlovePIE's window because of the
|
|
// syntax highlighter. Minimise GlovePIE to see it properly.
|
|
|
|
// This script has mouse 1 controlling the real mouse pointer, and up
|
|
// to 3 other mice controlling fake mouse pointers. The fake mouse
|
|
// pointers will have a coloured number next to them.
|
|
|
|
// All mouse pointers start in the same spot as the original cursor
|
|
// until you move them.
|
|
|
|
if starting then
|
|
cursor2.visible = false
|
|
cursor3.visible = false
|
|
cursor4.visible = false
|
|
endif
|
|
|
|
// The real cursor is now only controlled by mouse 1
|
|
mouse.Swallow = true
|
|
fakemouse.DirectInputX = mouse1.DirectInputX
|
|
fakemouse.DirectInputY = mouse1.DirectInputY
|
|
mouse.LeftButton = mouse1.LeftButton
|
|
mouse.RightButton = mouse1.RightButton
|
|
mouse.MiddleButton = mouse1.MiddleButton
|
|
mouse.XButton1 = mouse1.XButton1
|
|
mouse.XButton2 = mouse1.XButton2
|
|
|
|
// Show a fake cursor 2
|
|
if mouse2.present but not var.shown2 then
|
|
cursor2.visible = true
|
|
var.Mouse2x = mouse.CursorPosX
|
|
var.Mouse2y = mouse.CursorPosY
|
|
var.shown2 = true
|
|
endif
|
|
|
|
// Show a fake cursor 3
|
|
if mouse3.present but not var.shown3 then
|
|
cursor3.visible = true
|
|
var.Mouse3x = mouse.CursorPosX
|
|
var.Mouse3y = mouse.CursorPosY
|
|
var.shown3 = true
|
|
endif
|
|
|
|
// Show a fake cursor 4
|
|
if mouse4.present but not var.shown4 then
|
|
cursor4.visible = true
|
|
var.Mouse4x = mouse.CursorPosX
|
|
var.Mouse4y = mouse.CursorPosY
|
|
var.shown4 = true
|
|
endif
|
|
|
|
// Do mouse pointer 2
|
|
if mouse2.present then
|
|
// How much has mouse 2 moved?
|
|
var.deltax2 = Delta(mouse2.DirectInputX)
|
|
var.deltay2 = Delta(mouse2.DirectInputY)
|
|
|
|
// Mouse ballistics attempt
|
|
var.velocity = ([(smooth(var.deltaX2) / 24ms) in inches per second, (smooth(var.deltaY2) / 24ms) in inches per second] )
|
|
var.speed = |var.velocity|
|
|
if var.speed <= 0.2 then
|
|
var.deltax2 = var.deltax2 * 2
|
|
var.deltay2 = var.deltay2 * 2
|
|
endif
|
|
if var.speed > 0.2 and var.speed <= 0.4 then
|
|
var.deltax2 = var.deltax2 * 4
|
|
var.deltay2 = var.deltay2 * 4
|
|
endif
|
|
if var.speed > 0.4 and var.speed <= 1.25 then
|
|
var.deltax2 = var.deltax2 * 7
|
|
var.deltay2 = var.deltay2 * 7
|
|
endif
|
|
if var.speed > 1.25 and var.speed <= 3.9 then
|
|
var.deltax2 = var.deltax2 *12 //* 7
|
|
var.deltay2 = var.deltay2 *12 //* 7
|
|
endif
|
|
if var.speed > 3.9 then
|
|
var.deltax2 = var.deltax2 * 20// * 13.77
|
|
var.deltay2 = var.deltay2 * 20// * 13.77
|
|
endif
|
|
var.Mouse2x = var.Mouse2x pixels + (var.deltax2 in pixels)
|
|
var.Mouse2y = var.Mouse2y pixels + (var.deltay2 in pixels)
|
|
if var.Mouse2x < screen.DesktopLeft then var.Mouse2x = screen.DesktopLeft
|
|
if var.Mouse2x > screen.DesktopRight then var.Mouse2x = screen.DesktopRight
|
|
if var.Mouse2y < screen.DesktopTop then var.Mouse2y = screen.DesktopTop
|
|
if var.Mouse2y > screen.DesktopBottom then var.Mouse2y = screen.DesktopBottom
|
|
endif
|
|
Cursor2.PosX = var.Mouse2x
|
|
Cursor2.PosY = var.Mouse2y
|
|
Cursor2.LeftButton = mouse2.LeftButton
|
|
Cursor2.RightButton = mouse2.RightButton
|
|
Cursor2.MiddleButton = mouse2.MiddleButton
|
|
|
|
// Do mouse pointer 3
|
|
if mouse3.present then
|
|
// How much has mouse 2 moved?
|
|
var.deltax3 = Delta(mouse3.DirectInputX)
|
|
var.deltay3 = Delta(mouse3.DirectInputY)
|
|
|
|
// Mouse ballistics attempt
|
|
var.velocity = ([(smooth(var.deltaX3) / 24ms) in inches per second, (smooth(var.deltaY3) / 24ms) in inches per second] )
|
|
var.speed = |var.velocity|
|
|
if var.speed <= 0.2 then
|
|
var.deltax3 = var.deltax3 * 2
|
|
var.deltay3 = var.deltay3 * 2
|
|
endif
|
|
if var.speed > 0.2 and var.speed <= 0.4 then
|
|
var.deltax3 = var.deltax3 * 4
|
|
var.deltay3 = var.deltay3 * 4
|
|
endif
|
|
if var.speed > 0.4 and var.speed <= 1.25 then
|
|
var.deltax3 = var.deltax3 * 7
|
|
var.deltay3 = var.deltay3 * 7
|
|
endif
|
|
if var.speed > 1.25 and var.speed <= 3.9 then
|
|
var.deltax3 = var.deltax3 *12 //* 7
|
|
var.deltay3 = var.deltay3 *12 //* 7
|
|
endif
|
|
if var.speed > 3.9 then
|
|
var.deltax3 = var.deltax3 * 20// * 13.77
|
|
var.deltay3 = var.deltay3 * 20// * 13.77
|
|
endif
|
|
var.Mouse3x = var.Mouse3x pixels + (var.deltax3 in pixels)
|
|
var.Mouse3y = var.Mouse3y pixels + (var.deltay3 in pixels)
|
|
if var.Mouse3x < screen.DesktopLeft then var.Mouse3x = screen.DesktopLeft
|
|
if var.Mouse3x > screen.DesktopRight then var.Mouse3x = screen.DesktopRight
|
|
if var.Mouse3y < screen.DesktopTop then var.Mouse3y = screen.DesktopTop
|
|
if var.Mouse3y > screen.DesktopBottom then var.Mouse3y = screen.DesktopBottom
|
|
endif
|
|
Cursor3.PosX = var.Mouse3x
|
|
Cursor3.PosY = var.Mouse3y
|
|
Cursor3.LeftButton = mouse3.LeftButton
|
|
Cursor3.RightButton = mouse3.RightButton
|
|
Cursor3.MiddleButton = mouse3.MiddleButton
|
|
|
|
// Do mouse pointer 4
|
|
if mouse4.present then
|
|
// How much has mouse 2 moved?
|
|
var.deltax4 = Delta(mouse4.DirectInputX)
|
|
var.deltay4 = Delta(mouse4.DirectInputY)
|
|
|
|
// Mouse ballistics attempt
|
|
var.velocity = ([(smooth(var.deltaX4) / 24ms) in inches per second, (smooth(var.deltaY4) / 24ms) in inches per second] )
|
|
var.speed = |var.velocity|
|
|
if var.speed <= 0.2 then
|
|
var.deltax4 = var.deltax4 * 2
|
|
var.deltay4 = var.deltay4 * 2
|
|
endif
|
|
if var.speed > 0.2 and var.speed <= 0.4 then
|
|
var.deltax4 = var.deltax4 * 4
|
|
var.deltay4 = var.deltay4 * 4
|
|
endif
|
|
if var.speed > 0.4 and var.speed <= 1.25 then
|
|
var.deltax4 = var.deltax4 * 7
|
|
var.deltay4 = var.deltay4 * 7
|
|
endif
|
|
if var.speed > 1.25 and var.speed <= 3.9 then
|
|
var.deltax4 = var.deltax4 *12 //* 7
|
|
var.deltay4 = var.deltay4 *12 //* 7
|
|
endif
|
|
if var.speed > 3.9 then
|
|
var.deltax4 = var.deltax4 * 20// * 13.77
|
|
var.deltay4 = var.deltay4 * 20// * 13.77
|
|
endif
|
|
var.Mouse4x = var.Mouse4x pixels + (var.deltax4 in pixels)
|
|
var.Mouse4y = var.Mouse4y pixels + (var.deltay4 in pixels)
|
|
if var.Mouse4x < screen.DesktopLeft then var.Mouse4x = screen.DesktopLeft
|
|
if var.Mouse4x > screen.DesktopRight then var.Mouse4x = screen.DesktopRight
|
|
if var.Mouse4y < screen.DesktopTop then var.Mouse4y = screen.DesktopTop
|
|
if var.Mouse4y > screen.DesktopBottom then var.Mouse4y = screen.DesktopBottom
|
|
endif
|
|
Cursor4.PosX = var.Mouse4x
|
|
Cursor4.PosY = var.Mouse4y
|
|
Cursor4.LeftButton = mouse4.LeftButton
|
|
Cursor4.RightButton = mouse4.RightButton
|
|
Cursor4.MiddleButton = mouse4.MiddleButton
|
|
|
|
|
|
|
|
|