Changeset edb3cf2 in mainline


Ignore:
Timestamp:
2011-12-28T11:46:33Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
70172dc4
Parents:
acac2ef
Message:

input: Move mouse wheel handling to input service.

Location:
uspace
Files:
6 edited

Legend:

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

    racac2ef redb3cf2  
    152152
    153153/*----------------------------------------------------------------------------*/
    154 
     154#if 0
    155155static void usb_mouse_send_wheel(const usb_mouse_t *mouse_dev, int wheel)
    156156{
     
    177177        }
    178178}
    179 
     179#endif
    180180/*----------------------------------------------------------------------------*/
    181181
     
    221221            &hid_dev->report, USB_HIDUT_USAGE_GENERIC_DESKTOP_WHEEL);
    222222
    223         if ((shift_x != 0) || (shift_y != 0)) {
     223        if (shift_x || shift_y || wheel) {
    224224                async_exch_t *exch =
    225225                    async_exchange_begin(mouse_dev->mouse_sess);
    226226                if (exch != NULL) {
    227                         async_req_2_0(exch, MOUSEEV_MOVE_EVENT, shift_x, shift_y);
     227                        async_msg_3(exch, MOUSEEV_MOVE_EVENT,
     228                            shift_x, shift_y, wheel);
    228229                        async_exchange_end(exch);
    229230                }
    230231        }
    231 
     232#if 0
    232233        if (wheel != 0)
    233                 usb_mouse_send_wheel(mouse_dev, wheel);
    234 
     234                (void)usb_mouse_send_wheel(mouse_dev, wheel);
     235#endif
    235236        /* Buttons */
    236237        usb_hid_report_path_t *path = usb_hid_report_path();
  • uspace/srv/hid/input/generic/input.c

    racac2ef redb3cf2  
    172172
    173173/** Mouse pointer has moved. */
    174 void mouse_push_event_move(mouse_dev_t *mdev, int dx, int dy)
     174void mouse_push_event_move(mouse_dev_t *mdev, int dx, int dy, int dz)
    175175{
    176176        async_exch_t *exch = async_exchange_begin(client_sess);
    177         async_msg_2(exch, INPUT_EVENT_MOVE, dx, dy);
     177        if (dx || dy)
     178                async_msg_2(exch, INPUT_EVENT_MOVE, dx, dy);
     179        if (dz) {
     180                keycode_t code = dz > 0 ? KC_UP : KC_DOWN;
     181                for (int i = 0; i < 3; ++i) {
     182                        async_msg_4(exch, INPUT_EVENT_KEY, KEY_PRESS, code, 0, 0);
     183                }
     184                async_msg_4(exch, INPUT_EVENT_KEY, KEY_RELEASE, code, 0, 0);
     185        }
    178186        async_exchange_end(exch);
    179187}
  • uspace/srv/hid/input/include/mouse.h

    racac2ef redb3cf2  
    6262
    6363extern void mouse_push_data(mouse_dev_t *, sysarg_t);
    64 extern void mouse_push_event_move(mouse_dev_t *, int, int);
     64extern void mouse_push_event_move(mouse_dev_t *, int, int, int);
    6565extern void mouse_push_event_button(mouse_dev_t *, int, int);
    6666
  • uspace/srv/hid/input/proto/adb.c

    racac2ef redb3cf2  
    8282       
    8383        if (dx != 0 || dy != 0)
    84                 mouse_push_event_move(mouse_dev, dx, dy);
     84                mouse_push_event_move(mouse_dev, dx, dy, 0);
    8585}
    8686
  • uspace/srv/hid/input/proto/mousedev.c

    racac2ef redb3cf2  
    9191                switch (IPC_GET_IMETHOD(call)) {
    9292                case MOUSEEV_MOVE_EVENT:
    93                         mouse_push_event_move(mousedev->mouse_dev, IPC_GET_ARG1(call),
    94                             IPC_GET_ARG2(call));
     93                        mouse_push_event_move(mousedev->mouse_dev,
     94                            IPC_GET_ARG1(call), IPC_GET_ARG2(call),
     95                            IPC_GET_ARG3(call));
    9596                        retval = EOK;
    9697                        break;
    9798                case MOUSEEV_BUTTON_EVENT:
    98                         mouse_push_event_button(mousedev->mouse_dev, IPC_GET_ARG1(call),
    99                             IPC_GET_ARG2(call));
     99                        mouse_push_event_button(mousedev->mouse_dev,
     100                            IPC_GET_ARG1(call), IPC_GET_ARG2(call));
    100101                        retval = EOK;
    101102                        break;
  • uspace/srv/hid/input/proto/ps2.c

    racac2ef redb3cf2  
    126126               
    127127                if (x != 0 || y != 0)
    128                         mouse_push_event_move(mouse_dev, x, y);
     128                        mouse_push_event_move(mouse_dev, x, y, 0);
    129129        }
    130130}
Note: See TracChangeset for help on using the changeset viewer.