2004-05-30 11:09:46 +00:00
|
|
|
# $Id$
|
2004-05-24 07:49:50 +00:00
|
|
|
# Documentation for SCA_MouseSensor
|
|
|
|
from SCA_ISensor import *
|
|
|
|
|
|
|
|
class SCA_MouseSensor(SCA_ISensor):
|
|
|
|
"""
|
|
|
|
Mouse Sensor logic brick.
|
2009-01-26 08:34:40 +00:00
|
|
|
|
|
|
|
Properties:
|
|
|
|
|
|
|
|
@ivar position: current [x,y] coordinates of the mouse, in frame coordinates (pixels)
|
|
|
|
@type position: [integer,interger]
|
|
|
|
@ivar mode: sensor mode: 1=KX_MOUSESENSORMODE_LEFTBUTTON 2=KX_MOUSESENSORMODE_MIDDLEBUTTON
|
|
|
|
3=KX_MOUSESENSORMODE_RIGHTBUTTON 4=KX_MOUSESENSORMODE_WHEELUP
|
|
|
|
5=KX_MOUSESENSORMODE_WHEELDOWN 9=KX_MOUSESENSORMODE_MOVEMENT
|
|
|
|
@type mode: integer
|
2004-05-24 07:49:50 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
def getXPosition():
|
|
|
|
"""
|
2009-01-26 08:34:40 +00:00
|
|
|
DEPRECATED: use the position property
|
2004-05-24 07:49:50 +00:00
|
|
|
Gets the x coordinate of the mouse.
|
|
|
|
|
|
|
|
@rtype: integer
|
|
|
|
@return: the current x coordinate of the mouse, in frame coordinates (pixels)
|
|
|
|
"""
|
|
|
|
def getYPosition():
|
|
|
|
"""
|
2009-01-26 08:34:40 +00:00
|
|
|
DEPRECATED: use the position property
|
2004-05-24 07:49:50 +00:00
|
|
|
Gets the y coordinate of the mouse.
|
|
|
|
|
|
|
|
@rtype: integer
|
|
|
|
@return: the current y coordinate of the mouse, in frame coordinates (pixels).
|
|
|
|
"""
|
2009-04-20 15:06:46 +00:00
|
|
|
def getButtonStatus(button):
|
|
|
|
"""
|
|
|
|
Get the mouse button status.
|
|
|
|
|
|
|
|
@type button: int
|
|
|
|
@param button: value in GameLogic members KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT
|
|
|
|
|
|
|
|
@rtype: integer
|
|
|
|
@return: value in GameLogic members KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED
|
|
|
|
"""
|