Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 295f658 in mainline


Ignore:
Timestamp:
2011-12-26T18:01:22Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
2b621cb
Parents:
c520034
Message:

usbhid: Refactoring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/mouse/mousedev.c

    rc520034 r295f658  
    259259                assert(index < mouse_dev->buttons_count);
    260260
    261                 if (mouse_dev->buttons[index] == 0 && field->value != 0) {
     261                if (mouse_dev->buttons[index] != field->value) {
    262262                        async_exch_t *exch =
    263263                            async_exchange_begin(mouse_dev->mouse_sess);
    264264                        if (exch != NULL) {
    265265                                async_req_2_0(exch, MOUSEEV_BUTTON_EVENT,
    266                                     field->usage, 1);
    267                                 async_exchange_end(exch);
    268                                 mouse_dev->buttons[index] = field->value;
    269                         }
    270 
    271                 } else if (mouse_dev->buttons[index] != 0 && field->value == 0) {
    272                         async_exch_t *exch =
    273                             async_exchange_begin(mouse_dev->mouse_sess);
    274                         if (exch != NULL) {
    275                                 async_req_2_0(exch, MOUSEEV_BUTTON_EVENT,
    276                                     field->usage, 0);
     266                                    field->usage, (field->value != 0) ? 1 : 0);
    277267                                async_exchange_end(exch);
    278268                                mouse_dev->buttons[index] = field->value;
Note: See TracChangeset for help on using the changeset viewer.