No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MouseParty.pie 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. // Click the RUN Button above -^ to start,
  2. // The mice must be plugged in before pressing RUN.
  3. // Don't click the title bar of THIS window with the REAL mouse or it
  4. // will freeze! This includes when it is minimized to the desktop.
  5. // You can click title bars of other windows with the real mouse, and
  6. // you can click this window's title bar with any fake mouse.
  7. // If it freezes, use Alt+Tab to fix it.
  8. // The mice will move slowly over GlovePIE's window because of the
  9. // syntax highlighter. Minimise GlovePIE to see it properly.
  10. // This script has mouse 1 controlling the real mouse pointer, and up
  11. // to 3 other mice controlling fake mouse pointers. The fake mouse
  12. // pointers will have a coloured number next to them.
  13. // All mouse pointers start in the same spot as the original cursor
  14. // until you move them.
  15. if starting then
  16. cursor2.visible = false
  17. cursor3.visible = false
  18. cursor4.visible = false
  19. endif
  20. // The real cursor is now only controlled by mouse 1
  21. mouse.Swallow = true
  22. fakemouse.DirectInputX = mouse1.DirectInputX
  23. fakemouse.DirectInputY = mouse1.DirectInputY
  24. mouse.LeftButton = mouse1.LeftButton
  25. mouse.RightButton = mouse1.RightButton
  26. mouse.MiddleButton = mouse1.MiddleButton
  27. mouse.XButton1 = mouse1.XButton1
  28. mouse.XButton2 = mouse1.XButton2
  29. // Show a fake cursor 2
  30. if mouse2.present but not var.shown2 then
  31. cursor2.visible = true
  32. var.Mouse2x = mouse.CursorPosX
  33. var.Mouse2y = mouse.CursorPosY
  34. var.shown2 = true
  35. endif
  36. // Show a fake cursor 3
  37. if mouse3.present but not var.shown3 then
  38. cursor3.visible = true
  39. var.Mouse3x = mouse.CursorPosX
  40. var.Mouse3y = mouse.CursorPosY
  41. var.shown3 = true
  42. endif
  43. // Show a fake cursor 4
  44. if mouse4.present but not var.shown4 then
  45. cursor4.visible = true
  46. var.Mouse4x = mouse.CursorPosX
  47. var.Mouse4y = mouse.CursorPosY
  48. var.shown4 = true
  49. endif
  50. // Do mouse pointer 2
  51. if mouse2.present then
  52. // How much has mouse 2 moved?
  53. var.deltax2 = Delta(mouse2.DirectInputX)
  54. var.deltay2 = Delta(mouse2.DirectInputY)
  55. // Mouse ballistics attempt
  56. var.velocity = ([(smooth(var.deltaX2) / 24ms) in inches per second, (smooth(var.deltaY2) / 24ms) in inches per second] )
  57. var.speed = |var.velocity|
  58. if var.speed <= 0.2 then
  59. var.deltax2 = var.deltax2 * 2
  60. var.deltay2 = var.deltay2 * 2
  61. endif
  62. if var.speed > 0.2 and var.speed <= 0.4 then
  63. var.deltax2 = var.deltax2 * 4
  64. var.deltay2 = var.deltay2 * 4
  65. endif
  66. if var.speed > 0.4 and var.speed <= 1.25 then
  67. var.deltax2 = var.deltax2 * 7
  68. var.deltay2 = var.deltay2 * 7
  69. endif
  70. if var.speed > 1.25 and var.speed <= 3.9 then
  71. var.deltax2 = var.deltax2 *12 //* 7
  72. var.deltay2 = var.deltay2 *12 //* 7
  73. endif
  74. if var.speed > 3.9 then
  75. var.deltax2 = var.deltax2 * 20// * 13.77
  76. var.deltay2 = var.deltay2 * 20// * 13.77
  77. endif
  78. var.Mouse2x = var.Mouse2x pixels + (var.deltax2 in pixels)
  79. var.Mouse2y = var.Mouse2y pixels + (var.deltay2 in pixels)
  80. if var.Mouse2x < screen.DesktopLeft then var.Mouse2x = screen.DesktopLeft
  81. if var.Mouse2x > screen.DesktopRight then var.Mouse2x = screen.DesktopRight
  82. if var.Mouse2y < screen.DesktopTop then var.Mouse2y = screen.DesktopTop
  83. if var.Mouse2y > screen.DesktopBottom then var.Mouse2y = screen.DesktopBottom
  84. endif
  85. Cursor2.PosX = var.Mouse2x
  86. Cursor2.PosY = var.Mouse2y
  87. Cursor2.LeftButton = mouse2.LeftButton
  88. Cursor2.RightButton = mouse2.RightButton
  89. Cursor2.MiddleButton = mouse2.MiddleButton
  90. // Do mouse pointer 3
  91. if mouse3.present then
  92. // How much has mouse 2 moved?
  93. var.deltax3 = Delta(mouse3.DirectInputX)
  94. var.deltay3 = Delta(mouse3.DirectInputY)
  95. // Mouse ballistics attempt
  96. var.velocity = ([(smooth(var.deltaX3) / 24ms) in inches per second, (smooth(var.deltaY3) / 24ms) in inches per second] )
  97. var.speed = |var.velocity|
  98. if var.speed <= 0.2 then
  99. var.deltax3 = var.deltax3 * 2
  100. var.deltay3 = var.deltay3 * 2
  101. endif
  102. if var.speed > 0.2 and var.speed <= 0.4 then
  103. var.deltax3 = var.deltax3 * 4
  104. var.deltay3 = var.deltay3 * 4
  105. endif
  106. if var.speed > 0.4 and var.speed <= 1.25 then
  107. var.deltax3 = var.deltax3 * 7
  108. var.deltay3 = var.deltay3 * 7
  109. endif
  110. if var.speed > 1.25 and var.speed <= 3.9 then
  111. var.deltax3 = var.deltax3 *12 //* 7
  112. var.deltay3 = var.deltay3 *12 //* 7
  113. endif
  114. if var.speed > 3.9 then
  115. var.deltax3 = var.deltax3 * 20// * 13.77
  116. var.deltay3 = var.deltay3 * 20// * 13.77
  117. endif
  118. var.Mouse3x = var.Mouse3x pixels + (var.deltax3 in pixels)
  119. var.Mouse3y = var.Mouse3y pixels + (var.deltay3 in pixels)
  120. if var.Mouse3x < screen.DesktopLeft then var.Mouse3x = screen.DesktopLeft
  121. if var.Mouse3x > screen.DesktopRight then var.Mouse3x = screen.DesktopRight
  122. if var.Mouse3y < screen.DesktopTop then var.Mouse3y = screen.DesktopTop
  123. if var.Mouse3y > screen.DesktopBottom then var.Mouse3y = screen.DesktopBottom
  124. endif
  125. Cursor3.PosX = var.Mouse3x
  126. Cursor3.PosY = var.Mouse3y
  127. Cursor3.LeftButton = mouse3.LeftButton
  128. Cursor3.RightButton = mouse3.RightButton
  129. Cursor3.MiddleButton = mouse3.MiddleButton
  130. // Do mouse pointer 4
  131. if mouse4.present then
  132. // How much has mouse 2 moved?
  133. var.deltax4 = Delta(mouse4.DirectInputX)
  134. var.deltay4 = Delta(mouse4.DirectInputY)
  135. // Mouse ballistics attempt
  136. var.velocity = ([(smooth(var.deltaX4) / 24ms) in inches per second, (smooth(var.deltaY4) / 24ms) in inches per second] )
  137. var.speed = |var.velocity|
  138. if var.speed <= 0.2 then
  139. var.deltax4 = var.deltax4 * 2
  140. var.deltay4 = var.deltay4 * 2
  141. endif
  142. if var.speed > 0.2 and var.speed <= 0.4 then
  143. var.deltax4 = var.deltax4 * 4
  144. var.deltay4 = var.deltay4 * 4
  145. endif
  146. if var.speed > 0.4 and var.speed <= 1.25 then
  147. var.deltax4 = var.deltax4 * 7
  148. var.deltay4 = var.deltay4 * 7
  149. endif
  150. if var.speed > 1.25 and var.speed <= 3.9 then
  151. var.deltax4 = var.deltax4 *12 //* 7
  152. var.deltay4 = var.deltay4 *12 //* 7
  153. endif
  154. if var.speed > 3.9 then
  155. var.deltax4 = var.deltax4 * 20// * 13.77
  156. var.deltay4 = var.deltay4 * 20// * 13.77
  157. endif
  158. var.Mouse4x = var.Mouse4x pixels + (var.deltax4 in pixels)
  159. var.Mouse4y = var.Mouse4y pixels + (var.deltay4 in pixels)
  160. if var.Mouse4x < screen.DesktopLeft then var.Mouse4x = screen.DesktopLeft
  161. if var.Mouse4x > screen.DesktopRight then var.Mouse4x = screen.DesktopRight
  162. if var.Mouse4y < screen.DesktopTop then var.Mouse4y = screen.DesktopTop
  163. if var.Mouse4y > screen.DesktopBottom then var.Mouse4y = screen.DesktopBottom
  164. endif
  165. Cursor4.PosX = var.Mouse4x
  166. Cursor4.PosY = var.Mouse4y
  167. Cursor4.LeftButton = mouse4.LeftButton
  168. Cursor4.RightButton = mouse4.RightButton
  169. Cursor4.MiddleButton = mouse4.MiddleButton