Guido van Rossum | c636014 | 1990-10-13 19:23:40 +0000 | [diff] [blame] | 1 | # 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 | |
| 12 | WE_NULL = 0 # not reported -- means 'no event' internally |
Guido van Rossum | c67eecf | 1991-11-19 20:41:32 +0000 | [diff] [blame] | 13 | WE_ACTIVATE = 1 # detail is None |
Guido van Rossum | c636014 | 1990-10-13 19:23:40 +0000 | [diff] [blame] | 14 | WE_CHAR = 2 # detail is the character |
| 15 | WE_COMMAND = 3 # detail is one of the WC_* constants below |
| 16 | WE_MOUSE_DOWN = 4 # detail is ((h, v), clicks, button, mask) |
| 17 | WE_MOUSE_MOVE = 5 # ditto |
| 18 | WE_MOUSE_UP = 6 # ditto |
| 19 | WE_MENU = 7 # detail is (menu, item) |
Guido van Rossum | c67eecf | 1991-11-19 20:41:32 +0000 | [diff] [blame] | 20 | WE_SIZE = 8 # detail is (width, height) |
Guido van Rossum | c636014 | 1990-10-13 19:23:40 +0000 | [diff] [blame] | 21 | WE_MOVE = 9 # not reported -- reserved for future use |
| 22 | WE_DRAW = 10 # detail is ((left, top), (right, bottom)) |
Guido van Rossum | c67eecf | 1991-11-19 20:41:32 +0000 | [diff] [blame] | 23 | WE_TIMER = 11 # detail is None |
| 24 | WE_DEACTIVATE = 12 # detail is None |
| 25 | WE_EXTERN = 13 # detail is None |
Guido van Rossum | be5ea23 | 1990-10-31 11:26:01 +0000 | [diff] [blame] | 26 | WE_KEY = 14 # detail is ??? |
| 27 | WE_LOST_SEL = 15 # detail is selection number |
Guido van Rossum | c67eecf | 1991-11-19 20:41:32 +0000 | [diff] [blame] | 28 | WE_CLOSE = 16 # detail is None |
Guido van Rossum | c636014 | 1990-10-13 19:23:40 +0000 | [diff] [blame] | 29 | |
| 30 | # Values for detail when type is WE_COMMAND: |
| 31 | |
Guido van Rossum | c67eecf | 1991-11-19 20:41:32 +0000 | [diff] [blame] | 32 | WC_CLOSE = 1 # obsolete; now reported as WE_CLOSE |
Guido van Rossum | c636014 | 1990-10-13 19:23:40 +0000 | [diff] [blame] | 33 | WC_LEFT = 2 # left arrow key |
| 34 | WC_RIGHT = 3 # right arrow key |
| 35 | WC_UP = 4 # up arrow key |
| 36 | WC_DOWN = 5 # down arrow key |
| 37 | WC_CANCEL = 6 # not reported -- turned into KeyboardInterrupt |
| 38 | WC_BACKSPACE = 7 # backspace key |
| 39 | WC_TAB = 8 # tab key |
| 40 | WC_RETURN = 9 # return or enter key |
Guido van Rossum | be5ea23 | 1990-10-31 11:26:01 +0000 | [diff] [blame] | 41 | |
| 42 | # Selection numbers |
| 43 | |
| 44 | WS_CLIPBOARD = 0 |
| 45 | WS_PRIMARY = 1 |
| 46 | WS_SECONDARY = 2 |
Guido van Rossum | 18fc569 | 1992-11-26 09:17:19 +0000 | [diff] [blame^] | 47 | |
| 48 | # Modifier masks in key and mouse events |
| 49 | |
| 50 | WM_SHIFT = (1 << 0) |
| 51 | WM_LOCK = (1 << 1) |
| 52 | WM_CONTROL = (1 << 2) |
| 53 | WM_META = (1 << 3) |
| 54 | WM_OPTION = (1 << 4) |
| 55 | WM_NUM = (1 << 5) |
| 56 | |
| 57 | WM_BUTTON1 = (1 << 8) |
| 58 | WM_BUTTON2 = (1 << 9) |
| 59 | WM_BUTTON3 = (1 << 10) |
| 60 | WM_BUTTON4 = (1 << 11) |
| 61 | WM_BUTTON5 = (1 << 12) |