Last change
on this file since 1284 was
1198,
checked in by Maciej Komosinski, 22 months ago
|
Added simple Python GUI for Framsticks library/server
|
File size:
946 bytes
|
Line | |
---|
1 | class Mouse:
|
---|
2 | MOUSE_NONE = 0
|
---|
3 | MOUSE_LEFT = 1
|
---|
4 | MOUSE_RIGHT = 2
|
---|
5 |
|
---|
6 | _dwheel = 0
|
---|
7 | _dbutton = MOUSE_NONE
|
---|
8 | _xactual = -1
|
---|
9 | _yactual = -1
|
---|
10 | _dx = -1
|
---|
11 | _dy = -1
|
---|
12 |
|
---|
13 | @staticmethod
|
---|
14 | def setDWheel(value: float):
|
---|
15 | Mouse._dwheel = value
|
---|
16 |
|
---|
17 | @staticmethod
|
---|
18 | def incrementDWheel(value: float):
|
---|
19 | Mouse._dwheel += value
|
---|
20 |
|
---|
21 | @staticmethod
|
---|
22 | def setButton(button: int):
|
---|
23 | Mouse._dbutton = button
|
---|
24 |
|
---|
25 | @staticmethod
|
---|
26 | def setXY(x: int, y: int):
|
---|
27 | Mouse._xactual = x
|
---|
28 | Mouse._yactual = y
|
---|
29 |
|
---|
30 | @staticmethod
|
---|
31 | def getDWheel() -> float:
|
---|
32 | t = Mouse._dwheel
|
---|
33 | Mouse._dwheel = 0
|
---|
34 | return t
|
---|
35 |
|
---|
36 | @staticmethod
|
---|
37 | def getX() -> float:
|
---|
38 | return Mouse._xactual
|
---|
39 |
|
---|
40 | @staticmethod
|
---|
41 | def getY() -> float:
|
---|
42 | return Mouse._yactual
|
---|
43 |
|
---|
44 | @staticmethod
|
---|
45 | def isButtonDown(button: int) -> bool:
|
---|
46 | return Mouse._dbutton == button |
---|
Note: See
TracBrowser
for help on using the repository browser.