StuBS
MouseDecoder Class Reference

Decoder for mouse codes received from the PS2Controller. More...

#include <machine/mousedecoder.h>

Collaboration diagram for MouseDecoder:
[legend]

Classes

union  MousePacket
 Structure of first packet. More...
 
struct  MousePacket.__unnamed58__
 

Public Member Functions

bool decode (unsigned char code)
 Decode the mouse packets.
 

Public Attributes

Pointer state
 Current position and state of the mouse.
 

Private Attributes

unsigned cycle = 0
 Next packet in cycle.
 
MousePacket status
 Content of last received status packet.
 

Detailed Description

Decoder for mouse codes received from the PS2Controller.

Extracts the mouse movements and button events.

Movements are reported with at least a 3-byte packet, depending on the extension (scroll wheel etc) sometimes more (but not handled here).

Bit 7 6 5 4 3 2 1 0
Byte 1 Y ovf X ovf Y sgn X sgn 1 M btn R btn L btn
Byte 2 X Movement
Byte 3 Y Movement
Byte 4 (ignored if present)
See also
The PS/2 Mouse Interface

Member Function Documentation

◆ decode()

bool MouseDecoder::decode ( unsigned char  code)

Decode the mouse packets.

Parameters
codeByte from Keyboard to decode
Returns
true if a 3-byte-packet was successfully decoded.

Member Data Documentation

◆ cycle

unsigned MouseDecoder::cycle = 0
private

Next packet in cycle.

◆ status

MousePacket MouseDecoder::status
private

Content of last received status packet.

◆ state

Pointer MouseDecoder::state

Current position and state of the mouse.


The documentation for this class was generated from the following files: