42 if (m_BufferIndex == 0 && !(
byte & StatusAlwaysOne)) {
46 m_Buffer[m_BufferIndex++] = byte;
47 if (m_BufferIndex != 3) {
51 const uint8_t status = m_Buffer[0];
52 const bool xOverflow = status & StatusXOverflow;
53 const bool yOverflow = status & StatusYOverflow;
55 packet.relativeX = xOverflow ? 0 : decodeMovement(m_Buffer[1], status, StatusXSign);
56 packet.relativeY = yOverflow ? 0 : decodeMovement(m_Buffer[2], status, StatusYSign);
57 packet.overflow = xOverflow || yOverflow;
62 if (status & StatusLeftButton) {
63 packet.buttons |= 1 << 0;
65 if (status & StatusMiddleButton) {
66 packet.buttons |= 1 << 1;
68 if (status & StatusRightButton) {
69 packet.buttons |= 1 << 2;