Changeset efdfebc in mainline for uspace/srv/hid/input/input.c


Ignore:
Timestamp:
2012-11-06T21:03:44Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
338810f
Parents:
de73242 (diff), 94795812 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/input.c

    rde73242 refdfebc  
    5454#include <io/keycode.h>
    5555#include <loc.h>
    56 #include <input.h>
    57 #include <kbd.h>
    58 #include <kbd_port.h>
    59 #include <kbd_ctl.h>
    60 #include <mouse_proto.h>
    61 #include <layout.h>
    62 #include <mouse.h>
     56#include "layout.h"
     57#include "kbd.h"
     58#include "kbd_port.h"
     59#include "kbd_ctl.h"
     60#include "mouse.h"
     61#include "mouse_proto.h"
     62#include "input.h"
    6363
    6464#define NUM_LAYOUTS  3
     
    189189        }
    190190        async_exchange_end(exch);
     191}
     192
     193/** Mouse pointer has moved in absolute mode. */
     194void mouse_push_event_abs_move(mouse_dev_t *mdev, unsigned int x, unsigned int y,
     195    unsigned int max_x, unsigned int max_y)
     196{
     197        if (max_x && max_y) {
     198                async_exch_t *exch = async_exchange_begin(client_sess);
     199                async_msg_4(exch, INPUT_EVENT_ABS_MOVE, x, y, max_x, max_y);
     200                async_exchange_end(exch);
     201        }
    191202}
    192203
     
    635646}
    636647
     648static void usage(char *name)
     649{
     650        printf("Usage: %s <service_name>\n", name);
     651}
     652
    637653int main(int argc, char **argv)
    638654{
     655        if (argc < 2) {
     656                usage(argv[0]);
     657                return 1;
     658        }
     659       
    639660        printf("%s: HelenOS input service\n", NAME);
    640661       
     
    667688        }
    668689       
    669         char kbd[LOC_NAME_MAXLEN + 1];
    670         snprintf(kbd, LOC_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME);
    671        
    672690        service_id_t service_id;
    673         rc = loc_service_register(kbd, &service_id);
    674         if (rc != EOK) {
    675                 printf("%s: Unable to register service %s\n", NAME, kbd);
     691        rc = loc_service_register(argv[1], &service_id);
     692        if (rc != EOK) {
     693                printf("%s: Unable to register service %s\n", NAME, argv[1]);
    676694                return rc;
    677695        }
     
    681699       
    682700        printf("%s: Accepting connections\n", NAME);
     701        task_retval(0);
    683702        async_manager();
    684703       
Note: See TracChangeset for help on using the changeset viewer.