blob: 62cf8d2931bb00e6c434589d221aecf5c643162e [file] [log] [blame]
Guido van Rossumc6360141990-10-13 19:23:40 +00001# Module 'stdwinevents' -- Constants for stdwin event types
2#
3# Suggested usage:
4# from stdwinevents import *
5
6# The function stdwin.getevent() returns a tuple containing:
7# (type, window, detail)
8# where detail may be <no value> or a value depending on type, see below:
9
10# Values for type:
11
12WE_NULL = 0 # not reported -- means 'no event' internally
Guido van Rossumc67eecf1991-11-19 20:41:32 +000013WE_ACTIVATE = 1 # detail is None
Guido van Rossumc6360141990-10-13 19:23:40 +000014WE_CHAR = 2 # detail is the character
15WE_COMMAND = 3 # detail is one of the WC_* constants below
16WE_MOUSE_DOWN = 4 # detail is ((h, v), clicks, button, mask)
17WE_MOUSE_MOVE = 5 # ditto
18WE_MOUSE_UP = 6 # ditto
19WE_MENU = 7 # detail is (menu, item)
Guido van Rossumc67eecf1991-11-19 20:41:32 +000020WE_SIZE = 8 # detail is (width, height)
Guido van Rossumc6360141990-10-13 19:23:40 +000021WE_MOVE = 9 # not reported -- reserved for future use
22WE_DRAW = 10 # detail is ((left, top), (right, bottom))
Guido van Rossumc67eecf1991-11-19 20:41:32 +000023WE_TIMER = 11 # detail is None
24WE_DEACTIVATE = 12 # detail is None
25WE_EXTERN = 13 # detail is None
Guido van Rossumbe5ea231990-10-31 11:26:01 +000026WE_KEY = 14 # detail is ???
27WE_LOST_SEL = 15 # detail is selection number
Guido van Rossumc67eecf1991-11-19 20:41:32 +000028WE_CLOSE = 16 # detail is None
Guido van Rossumc6360141990-10-13 19:23:40 +000029
30# Values for detail when type is WE_COMMAND:
31
Guido van Rossumc67eecf1991-11-19 20:41:32 +000032WC_CLOSE = 1 # obsolete; now reported as WE_CLOSE
Guido van Rossumc6360141990-10-13 19:23:40 +000033WC_LEFT = 2 # left arrow key
34WC_RIGHT = 3 # right arrow key
35WC_UP = 4 # up arrow key
36WC_DOWN = 5 # down arrow key
37WC_CANCEL = 6 # not reported -- turned into KeyboardInterrupt
38WC_BACKSPACE = 7 # backspace key
39WC_TAB = 8 # tab key
40WC_RETURN = 9 # return or enter key
Guido van Rossumbe5ea231990-10-31 11:26:01 +000041
42# Selection numbers
43
44WS_CLIPBOARD = 0
45WS_PRIMARY = 1
46WS_SECONDARY = 2
Guido van Rossum18fc5691992-11-26 09:17:19 +000047
48# Modifier masks in key and mouse events
49
50WM_SHIFT = (1 << 0)
51WM_LOCK = (1 << 1)
52WM_CONTROL = (1 << 2)
53WM_META = (1 << 3)
54WM_OPTION = (1 << 4)
55WM_NUM = (1 << 5)
56
57WM_BUTTON1 = (1 << 8)
58WM_BUTTON2 = (1 << 9)
59WM_BUTTON3 = (1 << 10)
60WM_BUTTON4 = (1 << 11)
61WM_BUTTON5 = (1 << 12)