MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Mouse_Handler

Function Mouse_Handler

src/video/video_atari.c:70–99  ·  view source on GitHub ↗

* Mouse interrupt Handler * * Receive and process Mouse IKBD packets. */

Source from the content-addressed store, hash-verified

68 * Receive and process Mouse IKBD packets.
69 */
70void Mouse_Handler(char * ikbd_packet)
71{
72 /* The relative mouse position record is a three byte record of the form
73 (regardless of keyboard mode):
74 %111110xy ; mouse position record flag
75 ; where y is the right button state
76 ; and x is the left button state
77 X ; delta x as twos complement integer
78 Y ; delta y as twos complement integer
79 */
80 s_mouse_x += (int)ikbd_packet[1];
81 s_mouse_y += (int)ikbd_packet[2];
82 if(s_mouse_x < s_mouse_x_min) {
83 s_mouse_x = s_mouse_x_min;
84 } else if(s_mouse_x > s_mouse_x_max) {
85 s_mouse_x = s_mouse_x_max;
86 }
87 if(s_mouse_y < s_mouse_y_min) {
88 s_mouse_y = s_mouse_y_min;
89 } else if(s_mouse_y > s_mouse_y_max) {
90 s_mouse_y = s_mouse_y_max;
91 }
92#if 0
93 Mouse_EventHandler(s_mouse_x, s_mouse_y,
94 ikbd_packet[0]&2 /*left*/, ikbd_packet[0]&1 /*right*/);
95#endif
96 s_mouse_left_btn = ikbd_packet[0]&2;
97 s_mouse_right_btn = ikbd_packet[0]&1;
98 s_mouse_state_changed = true;
99}
100
101static void Detect_Machine(void)
102{

Callers

nothing calls this directly

Calls 1

Mouse_EventHandlerFunction · 0.85

Tested by

no test coverage detected