-
Notifications
You must be signed in to change notification settings - Fork 48
/
Mouse.py
38 lines (35 loc) · 974 Bytes
/
Mouse.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import wx
import HeeksCAD
def MouseEventFromWx(w):
e = HeeksCAD.MouseEvent()
if w.LeftDown():
e.m_event_type = 1
elif w.LeftUp():
e.m_event_type = 2
elif w.LeftDClick():
e.m_event_type = 3
elif w.RightDown():
e.m_event_type = 4
elif w.RightUp():
e.m_event_type = 5
elif w.MiddleDown():
e.m_event_type = 6
elif w.MiddleUp():
e.m_event_type = 7
elif w.Dragging() or w.Moving():
e.m_event_type = 8
elif w.GetWheelRotation():
e.m_event_type = 9
e.m_x = w.m_x
e.m_y = w.m_y
e.m_leftDown = w.m_leftDown
e.m_middleDown = w.m_middleDown
e.m_rightDown = w.m_rightDown
e.m_controlDown = w.m_controlDown
e.m_shiftDown = w.m_shiftDown
e.m_altDown = w.m_altDown
e.m_metaDown = w.m_metaDown
e.m_wheelRotation = w.m_wheelRotation
e.m_wheelDelta = w.m_wheelDelta
e.m_linesPerAction = w.m_linesPerAction
return e