Decoder for mouse codes received from the PS2Controller.
More...
#include <machine/mousedecoder.h>
|
bool | decode (unsigned char code) |
| Decode the mouse packets. More...
|
|
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
◆ MouseDecoder::MousePacket.__unnamed__
struct MouseDecoder::MousePacket.__unnamed__ |
Class Members |
uint8_t |
button_left: 1 |
|
uint8_t |
button_right: 1 |
|
uint8_t |
button_middle: 1 |
|
uint8_t |
always_1: 1 |
|
uint8_t |
sign_x: 1 |
|
uint8_t |
sign_y: 1 |
|
uint8_t |
overflow_x: 1 |
|
uint8_t |
overflow_y: 1 |
|
◆ decode()
bool MouseDecoder::decode |
( |
unsigned char |
code | ) |
|
Decode the mouse packets.
- Parameters
-
code | Byte from Keyboard to decode |
- Returns
true
if a 3-byte-packet was successfully decoded.
The documentation for this class was generated from the following files: