campy.gui.events.key module

Interact with the graphics libraries via key events.

NOTE(sredmond): This module is still heavily under development, and should be considered incomplete by all users.

Usage:

@campy.onkeypress('a', modifier=SHIFT | CTRL)
campy.keypress('a')
class campy.gui.events.key.KeyCodes[source]

Bases: enum.Enum

BACKSPACE_KEY = 8
CLEAR_KEY = 12
DELETE_KEY = 127
DOWN_ARROW_KEY = 40
END_KEY = 35
ENTER_KEY = 10
ESCAPE_KEY = 27
F10_KEY = 121
F11_KEY = 122
F12_KEY = 123
F1_KEY = 112
F2_KEY = 113
F3_KEY = 114
F4_KEY = 115
F5_KEY = 116
F6_KEY = 117
F7_KEY = 118
F8_KEY = 119
F9_KEY = 120
HELP_KEY = 156
HOME_KEY = 36
LEFT_ARROW_KEY = 37
PAGE_DOWN_KEY = 34
PAGE_UP_KEY = 33
RIGHT_ARROW_KEY = 39
TAB_KEY = 9
UP_ARROW_KEY = 38
class campy.gui.events.key.Modifier[source]

Bases: enum.Enum

ALT_DOWN = 8
ALT_GRAPH_DOWN = 16
BUTTON1_DOWN = 32
BUTTON2_DOWN = 64
BUTTON3_DOWN = 128
CTRL_DOWN = 2
META_DOWN = 4
SHIFT_DOWN = 1
campy.gui.events.key.keypress(key, modifiers=None)[source]

Fire a key-pressed event.

campy.gui.events.key.onkeypress(key, modifiers=None)[source]
campy.gui.events.key.setup()[source]