Changeset 21bb58d in mainline for uspace/drv/usbmouse/mouse.c


Ignore:
Timestamp:
2011-03-02T20:20:42Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
24aa62c, 5dd9209
Parents:
103ae7f8
Message:

USB mouse sends events to console

The values are not properly scaled, the clicking is very simple
(doubt that the console is able to handle something more
complicated) but it is possible to switch consoles with the mouse.

Tested in QEMU only.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbmouse/mouse.c

    r103ae7f8 r21bb58d  
    3737#include <usb/debug.h>
    3838#include <errno.h>
     39#include <ipc/mouse.h>
    3940
    4041int usb_mouse_polling_fibril(void *arg)
     
    9495                }
    9596
     97                if (mouse->console_phone >= 0) {
     98                        if ((shift_x != 0) || (shift_y != 0)) {
     99                                /* FIXME: guessed for QEMU */
     100                                async_req_2_0(mouse->console_phone,
     101                                    MEVENT_MOVE,
     102                                    - shift_x / 10,  - shift_y / 10);
     103                        }
     104                        if (butt) {
     105                                /* FIXME: proper button clicking. */
     106                                async_req_2_0(mouse->console_phone,
     107                                    MEVENT_BUTTON, 1, 1);
     108                                async_req_2_0(mouse->console_phone,
     109                                    MEVENT_BUTTON, 1, 0);
     110                        }
     111                }
     112
    96113                usb_log_debug("buttons=%s  dX=%+3d  dY=%+3d  wheel=%+3d\n",
    97114                   str_buttons, shift_x, shift_y, wheel);
Note: See TracChangeset for help on using the changeset viewer.