Revision 5fafdf24 hw/ps2.c
b/hw/ps2.c | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* QEMU PS/2 keyboard/mouse emulation |
3 |
*
|
|
3 |
* |
|
4 | 4 |
* Copyright (c) 2003 Fabrice Bellard |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | 7 |
* of this software and associated documentation files (the "Software"), to deal |
8 | 8 |
* in the Software without restriction, including without limitation the rights |
... | ... | |
146 | 146 |
PS2State *s = (PS2State *)opaque; |
147 | 147 |
PS2Queue *q; |
148 | 148 |
int val, index; |
149 |
|
|
149 |
|
|
150 | 150 |
q = &s->queue; |
151 | 151 |
if (q->count == 0) { |
152 | 152 |
/* NOTE: if no data left, we return the last keyboard one |
... | ... | |
294 | 294 |
s->mouse_dz -= dz1; |
295 | 295 |
} |
296 | 296 |
|
297 |
static void ps2_mouse_event(void *opaque,
|
|
297 |
static void ps2_mouse_event(void *opaque, |
|
298 | 298 |
int dx, int dy, int dz, int buttons_state) |
299 | 299 |
{ |
300 | 300 |
PS2MouseState *s = opaque; |
... | ... | |
311 | 311 |
s->mouse_buttons == buttons_state) |
312 | 312 |
return; |
313 | 313 |
s->mouse_buttons = buttons_state; |
314 |
|
|
314 |
|
|
315 | 315 |
if (!(s->mouse_status & MOUSE_STATUS_REMOTE) && |
316 | 316 |
(s->common.queue.count < (PS2_QUEUE_SIZE - 16))) { |
317 | 317 |
for(;;) { |
... | ... | |
434 | 434 |
s->mouse_detect_state = 0; |
435 | 435 |
break; |
436 | 436 |
case 2: |
437 |
if (val == 80)
|
|
437 |
if (val == 80) |
|
438 | 438 |
s->mouse_type = 3; /* IMPS/2 */ |
439 | 439 |
s->mouse_detect_state = 0; |
440 | 440 |
break; |
441 | 441 |
case 3: |
442 |
if (val == 80)
|
|
442 |
if (val == 80) |
|
443 | 443 |
s->mouse_type = 4; /* IMEX */ |
444 | 444 |
s->mouse_detect_state = 0; |
445 | 445 |
break; |
Also available in: Unified diff