Revision 3b46e624 hw/usb-hid.c

b/hw/usb-hid.c
102 102
				     5: Remote wakeup,
103 103
				     4..0: resvd */
104 104
	50,         /*  u8  MaxPower; */
105
     
105

  
106 106
	/* USB 1.1:
107 107
	 * USB 2.0, single TT organization (mandatory):
108 108
	 *	one interface, protocol 0
......
124 124
	0x01,       /*  u8  if_bInterfaceSubClass; */
125 125
	0x02,       /*  u8  if_bInterfaceProtocol; [usb1.1 or single tt] */
126 126
	0x07,       /*  u8  if_iInterface; */
127
    
127

  
128 128
        /* HID descriptor */
129 129
        0x09,        /*  u8  bLength; */
130 130
        0x21,        /*  u8 bDescriptorType; */
......
157 157
				     5: Remote wakeup,
158 158
				     4..0: resvd */
159 159
	50,         /*  u8  MaxPower; */
160
     
160

  
161 161
	/* USB 1.1:
162 162
	 * USB 2.0, single TT organization (mandatory):
163 163
	 *	one interface, protocol 0
......
474 474
                                                  0, "QEMU USB Mouse");
475 475
	s->mouse_grabbed = 1;
476 476
    }
477
   
477

  
478 478
    dx = int_clamp(s->dx, -128, 127);
479 479
    dy = int_clamp(s->dy, -128, 127);
480 480
    dz = int_clamp(s->dz, -128, 127);
......
482 482
    s->dx -= dx;
483 483
    s->dy -= dy;
484 484
    s->dz -= dz;
485
   
485

  
486 486
    b = 0;
487 487
    if (s->buttons_state & MOUSE_EVENT_LBUTTON)
488 488
        b |= 0x01;
......
490 490
        b |= 0x02;
491 491
    if (s->buttons_state & MOUSE_EVENT_MBUTTON)
492 492
        b |= 0x04;
493
   
493

  
494 494
    buf[0] = b;
495 495
    buf[1] = dx;
496 496
    buf[2] = dy;
......
512 512
                                                  1, "QEMU USB Tablet");
513 513
	s->mouse_grabbed = 1;
514 514
    }
515
   
515

  
516 516
    dz = int_clamp(s->dz, -128, 127);
517 517
    s->dz -= dz;
518 518

  

Also available in: Unified diff