MCPcopy Create free account
hub / github.com/asottile/nintendo-microcontrollers / cb

Function cb

scripts/engine.py:43–51  ·  view source on GitHub ↗
(event: int, x: int, y: int, flags: object, param: object)

Source from the content-addressed store, hash-verified

41 end: Point | None = None
42
43 def cb(event: int, x: int, y: int, flags: object, param: object) -> None:
44 nonlocal start, pos, end
45
46 if event == cv2.EVENT_MOUSEMOVE:
47 pos = Point(y=y, x=x)
48 elif event == cv2.EVENT_LBUTTONDOWN:
49 start = Point(y=y, x=x)
50 elif event == cv2.EVENT_LBUTTONUP:
51 end = Point(y=y, x=x)
52
53 cv2.namedWindow('game')
54 cv2.setMouseCallback('game', cb)

Callers

nothing calls this directly

Calls 1

PointClass · 0.85

Tested by

no test coverage detected