| 176 | } |
| 177 | |
| 178 | static void UpdateMouseButtons(int buttons) { |
| 179 | // BeOS API is really odd in that it only provides you with a bitmask |
| 180 | // of 'current mouse buttons pressed' |
| 181 | int changed = buttons ^ last_buttons; |
| 182 | |
| 183 | // TODO move logic to UpdateMouseButton instead? |
| 184 | if (changed & B_PRIMARY_MOUSE_BUTTON) |
| 185 | UpdateMouseButton(CCMOUSE_L, buttons & B_PRIMARY_MOUSE_BUTTON); |
| 186 | if (changed & B_SECONDARY_MOUSE_BUTTON) |
| 187 | UpdateMouseButton(CCMOUSE_R, buttons & B_SECONDARY_MOUSE_BUTTON); |
| 188 | if (changed & B_TERTIARY_MOUSE_BUTTON) |
| 189 | UpdateMouseButton(CCMOUSE_M, buttons & B_TERTIARY_MOUSE_BUTTON); |
| 190 | if (changed & B_MOUSE_BUTTON(4)) |
| 191 | UpdateMouseButton(CCMOUSE_X1, buttons & B_MOUSE_BUTTON(4)); |
| 192 | if (changed & B_MOUSE_BUTTON(5)) |
| 193 | UpdateMouseButton(CCMOUSE_X2, buttons & B_MOUSE_BUTTON(5)); |
| 194 | |
| 195 | last_buttons = buttons; |
| 196 | } |
| 197 | |
| 198 | static void HandleMouseMovement(BMessage* msg) { |
| 199 | int32 dx, dy; |
no test coverage detected