Skip to content

Lab 4 check ​

Run the mouse tests with deterministic scripts before debugging movement visually. Packet failures can look like random cursor motion, so verify byte assembly, synchronization, and sign conversion with fixed input first.

sh
lcom-ng test mouse
lcom-ng run --headless --script scripts/mouse_move.mlabscript -- build/examples/mouse_packet

Discussion prompts ​

  • Why does packet byte 0 include a constant synchronization bit?
  • How would you implement drag detection from button state and deltas?
  • Which helpers would a drawing program need before using the mouse library?

External reading ​

The LCOM mouse introduction and mouse packet chapter are useful companions. For protocol details, read OSDev on mouse input and the PS/2 controller, plus Adam Chapweske's archived PS/2 Mouse Interface.

Course/docs licensed CC BY 4.0. Code licensed MIT.