1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """
17 This module contains flags and integer values used by the event system.
18 """
19
20 BUTTON_LEFT = 1
21 BUTTON_MIDDLE = 4
22 BUTTON_RIGHT = 2
23
24 ONBLUR = 0x01000
25 ONCHANGE = 0x00400
26 ONCLICK = 0x00001
27 ONCONTEXTMENU = 0x20000
28 ONDBLCLICK = 0x00002
29 ONERROR = 0x10000
30 ONFOCUS = 0x00800
31 ONKEYDOWN = 0x00080
32 ONKEYPRESS = 0x00100
33 ONKEYUP = 0x00200
34 ONLOAD = 0x08000
35 ONLOSECAPTURE = 0x02000
36 ONMOUSEDOWN = 0x00004
37 ONMOUSEMOVE = 0x00040
38 ONMOUSEOUT = 0x00020
39 ONMOUSEOVER = 0x00010
40 ONMOUSEUP = 0x00008
41 ONMOUSEWHEEL = 0x40000
42 ONSCROLL = 0x04000
43 ONINPUT = 0x80000
44 DRAGEVENTS = 0x100000
45 DROPEVENTS = 0x200000
46
47 FOCUSEVENTS = 0x01800
48 KEYEVENTS = 0x00380
49 MOUSEEVENTS = 0x0007C
50
51 eventbits = {
52
53 0x000001 : ("click", ["click"]),
54 0x000002 : ("dblclick", ["dblclick"]),
55 0x000004 : ("mousedown", ["mousedown"]),
56 0x000008 : ("mouseup", ["mouseup"]),
57 0x000010 : ("mouseover", ["mouseover"]),
58 0x000020 : ("mouseout", ["mouseout"]),
59 0x000040 : ("mousemove", ["mousemove"]),
60 0x000080 : ("keydown", ["keydown"]),
61 0x000100 : ("keypress", ["keypress"]),
62 0x000200 : ("keyup", ["keyup"]),
63 0x000400 : ("change", ["change"]),
64 0x000800 : ("focus", ["focus"]),
65 0x001000 : ("blur", ["blur"]),
66 0x002000 : ("losecapture", ["losecapture"]),
67 0x004000 : ("scroll", ["scroll"]),
68 0x008000 : ("load", ["load"]),
69 0x010000 : ("error", ["error"]),
70 0x020000 : ("contextmenu", ["contextmenu"]),
71 0x040000 : ("mousewheel", ["mousewheel"]),
72 0x080000 : ("input", ["input"]),
73 0x100000 : ("dragevents", ["drag", "dragstart", "dragend"]),
74 0x200000 : ("dropevents", ["drop", "dragenter", "dragover", "dragleave"]),
75 }
76
77
78
79 eventmap = {
80 "mousewheel": 0x040000,
81 "mousescroll": 0x040000,
82 "DOMMouseScroll": 0x040000,
83 "input": 0x080000,
84 "propertychange": 0x080000,
85 }
86
90
93
94 init()
95