MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / Pager

Class Pager

pager/pagerctl_mock.py:47–585  ·  view source on GitHub ↗

Pygame-based mock of the WiFi Pineapple Pager hardware.

Source from the content-addressed store, hash-verified

45
46
47class Pager:
48 """Pygame-based mock of the WiFi Pineapple Pager hardware."""
49
50 # Predefined colors (RGB565) - identical to real pagerctl
51 BLACK = 0x0000
52 WHITE = 0xFFFF
53 RED = 0xF800
54 GREEN = 0x07E0
55 BLUE = 0x001F
56 YELLOW = 0xFFE0
57 CYAN = 0x07FF
58 MAGENTA = 0xF81F
59 ORANGE = 0xFD20
60 PURPLE = 0x8010
61 GRAY = 0x8410
62
63 # Rotation modes
64 ROTATION_0 = 0
65 ROTATION_90 = 90
66 ROTATION_180 = 180
67 ROTATION_270 = 270
68
69 # Font sizes (built-in bitmap font)
70 FONT_SMALL = 1
71 FONT_MEDIUM = 2
72 FONT_LARGE = 3
73
74 # Button masks
75 BTN_UP = 0x01
76 BTN_DOWN = 0x02
77 BTN_LEFT = 0x04
78 BTN_RIGHT = 0x08
79 BTN_A = 0x10 # Green
80 BTN_B = 0x20 # Red
81 BTN_POWER = 0x40
82
83 # Input event types
84 EVENT_NONE = 0
85 EVENT_PRESS = 1
86 EVENT_RELEASE = 2
87
88 # RTTTL (no-op on mock)
89 RTTTL_SOUND_ONLY = 0
90 RTTTL_SOUND_VIBRATE = 1
91 RTTTL_VIBRATE_ONLY = 2
92 RTTTL_TETRIS = ""
93 RTTTL_GAME_OVER = ""
94 RTTTL_LEVEL_UP = ""
95
96 # Keyboard -> pager button mapping
97 _KEY_MAP = {
98 pygame.K_UP: 0x01,
99 pygame.K_DOWN: 0x02,
100 pygame.K_LEFT: 0x04,
101 pygame.K_RIGHT: 0x08,
102 pygame.K_RETURN: 0x10,
103 pygame.K_SPACE: 0x10,
104 pygame.K_z: 0x10,

Callers 1

pagerctl_mock.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected