stdwinevents.py 1.8 KB
Newer Older
Guido van Rossum's avatar
Guido van Rossum committed
1 2 3 4 5 6 7 8 9 10 11 12
# Module 'stdwinevents' -- Constants for stdwin event types
#
# Suggested usage:
#	from stdwinevents import *

# The function stdwin.getevent() returns a tuple containing:
#	(type, window, detail)
# where detail may be <no value> or a value depending on type, see below:

# Values for type:

WE_NULL       =  0	# not reported -- means 'no event' internally
13
WE_ACTIVATE   =  1	# detail is None
Guido van Rossum's avatar
Guido van Rossum committed
14 15 16 17 18 19
WE_CHAR       =  2	# detail is the character
WE_COMMAND    =  3	# detail is one of the WC_* constants below
WE_MOUSE_DOWN =  4	# detail is ((h, v), clicks, button, mask)
WE_MOUSE_MOVE =  5	# ditto
WE_MOUSE_UP   =  6	# ditto
WE_MENU       =  7	# detail is (menu, item)
20
WE_SIZE       =  8	# detail is (width, height)
Guido van Rossum's avatar
Guido van Rossum committed
21 22
WE_MOVE       =  9	# not reported -- reserved for future use
WE_DRAW       = 10	# detail is ((left, top), (right, bottom))
23 24 25
WE_TIMER      = 11	# detail is None
WE_DEACTIVATE = 12	# detail is None
WE_EXTERN     = 13	# detail is None
26 27
WE_KEY        = 14	# detail is ???
WE_LOST_SEL   = 15	# detail is selection number
28
WE_CLOSE      = 16	# detail is None
Guido van Rossum's avatar
Guido van Rossum committed
29 30 31

# Values for detail when type is WE_COMMAND:

32
WC_CLOSE      =  1	# obsolete; now reported as WE_CLOSE
Guido van Rossum's avatar
Guido van Rossum committed
33 34 35 36 37 38 39 40
WC_LEFT       =  2	# left arrow key
WC_RIGHT      =  3	# right arrow key
WC_UP         =  4	# up arrow key
WC_DOWN       =  5	# down arrow key
WC_CANCEL     =  6	# not reported -- turned into KeyboardInterrupt
WC_BACKSPACE  =  7	# backspace key
WC_TAB        =  8	# tab key
WC_RETURN     =  9	# return or enter key
41 42 43 44 45 46

# Selection numbers

WS_CLIPBOARD   = 0
WS_PRIMARY     = 1
WS_SECONDARY   = 2
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61

# Modifier masks in key and mouse events

WM_SHIFT       = (1 << 0)
WM_LOCK 	= (1 << 1)
WM_CONTROL 	= (1 << 2)
WM_META 	= (1 << 3)
WM_OPTION 	= (1 << 4)
WM_NUM 		= (1 << 5)

WM_BUTTON1 	= (1 << 8)
WM_BUTTON2 	= (1 << 9)
WM_BUTTON3 	= (1 << 10)
WM_BUTTON4 	= (1 << 11)
WM_BUTTON5 	= (1 << 12)