Module mouseHandler
[hide private]

Module mouseHandler

source code

Functions [hide private]
 
updateMouseShape(name) source code
 
playAudioCoordinates(x, y, screenWidth, screenHeight, screenMinPos, detectBrightness=True, blurFactor=0)
play audio coordinates:
source code
 
internal_mouseEvent(msg, x, y, injected) source code
 
getMouseRestrictedToScreens(x, y, displays)
Ensures that the mouse position is within the area of one of the displays, relative to (0,0) but not necessarily positive (which is as expected for mouse coordinates)
source code
 
getMinMaxPoints(screenRect) source code
 
getTotalWidthAndHeightAndMinimumPosition(displays)
Calculate the total screen width and height.
source code
 
executeMouseMoveEvent(x, y) source code
 
initialize() source code
 
_reportShape() source code
 
pumpAll() source code
 
terminate() source code
Variables [hide private]
  WM_MOUSEMOVE = 0x0200
  WM_LBUTTONDOWN = 0x0201
  WM_LBUTTONUP = 0x0202
  WM_LBUTTONDBLCLK = 0x0203
  WM_RBUTTONDOWN = 0x0204
  WM_RBUTTONUP = 0x0205
  WM_RBUTTONDBLCLK = 0x0206
  curMousePos = 0, 0
  mouseMoved = False
  curMouseShape = ""
  _shapeTimer = None
hash(x)
  scrBmpObj = None
hash(x)
float lastMouseEventTime = 0
The time (in seconds) at which the last mouse event occurred.
  SHAPE_REPORT_DELAY = 100
Function Details [hide private]

playAudioCoordinates(x, y, screenWidth, screenHeight, screenMinPos, detectBrightness=True, blurFactor=0)

source code 

play audio coordinates:

  • left to right adjusting the volume between left and right speakers
  • top to bottom adjusts the pitch of the sound
  • brightness adjusts the volume of the sound Coordinates (x, y) are absolute, and can be negative.

getMouseRestrictedToScreens(x, y, displays)

source code 

Ensures that the mouse position is within the area of one of the displays, relative to (0,0) but not necessarily positive (which is as expected for mouse coordinates)

We need to first get the closest point on the edge of each display rectangle (if the mouse is outside the rectangle). This is done by clamping the mouse position to the extents of each screen. The distance from this point to the actual mouse position can then be calculated. The smallest adjustment to get the mouse within the screen bounds is desired.

getTotalWidthAndHeightAndMinimumPosition(displays)

source code 

Calculate the total screen width and height.

Depending on screen layouts the rectangles may overlap on the vertical or horizontal axis. Screens may also have a gap between them. In the case where there is a gap in between we count that as contributing to the full virtual space