Changeset 03362fbd in mainline for uspace/srv/hid/input/input.c


Ignore:
Timestamp:
2013-02-09T23:14:45Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
22dfd38
Parents:
b5d2e57 (diff), 005b765 (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.

Conflict resulting from bool.h → stdbool.h move and ddf structs turning opaque.
Fails to boot to shell console.

File:
1 moved

Legend:

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

    rb5d2e57 r03362fbd  
    3838
    3939#include <adt/list.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141#include <fibril_synch.h>
    4242#include <ipc/services.h>
     
    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>
    63 
    64 #define NUM_LAYOUTS  3
     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"
     63
     64#define NUM_LAYOUTS  4
    6565
    6666static layout_ops_t *layout[NUM_LAYOUTS] = {
    6767        &us_qwerty_ops,
    6868        &us_dvorak_ops,
    69         &cz_ops
     69        &cz_ops,
     70        &ar_ops
    7071};
    7172
     
    163164        }
    164165       
     166        if (type == KEY_PRESS && (kdev->mods & KM_LCTRL) &&
     167            key == KC_F4) {
     168                layout_destroy(kdev->active_layout);
     169                kdev->active_layout = layout_create(layout[3]);
     170                return;
     171        }
     172       
    165173        ev.type = type;
    166174        ev.key = key;
     
    189197        }
    190198        async_exchange_end(exch);
     199}
     200
     201/** Mouse pointer has moved in absolute mode. */
     202void mouse_push_event_abs_move(mouse_dev_t *mdev, unsigned int x, unsigned int y,
     203    unsigned int max_x, unsigned int max_y)
     204{
     205        if (max_x && max_y) {
     206                async_exch_t *exch = async_exchange_begin(client_sess);
     207                async_msg_4(exch, INPUT_EVENT_ABS_MOVE, x, y, max_x, max_y);
     208                async_exchange_end(exch);
     209        }
    191210}
    192211
     
    412431        kbd_add_dev(&chardev_port, &stty_ctl);
    413432#endif
    414 #if defined(UARCH_arm32) && defined(MACHINE_testarm) && defined(CONFIG_FB)
    415         kbd_add_dev(&gxemul_port, &gxe_fb_ctl);
    416 #endif
    417 #if defined(UARCH_arm32) && defined(MACHINE_testarm) && !defined(CONFIG_FB)
    418         kbd_add_dev(&gxemul_port, &stty_ctl);
    419 #endif
    420433#if defined(UARCH_arm32) && defined(MACHINE_integratorcp)
    421434        kbd_add_dev(&pl050_port, &pc_ctl);
     
    635648}
    636649
     650static void usage(char *name)
     651{
     652        printf("Usage: %s <service_name>\n", name);
     653}
     654
    637655int main(int argc, char **argv)
    638656{
     657        if (argc < 2) {
     658                usage(argv[0]);
     659                return 1;
     660        }
     661       
    639662        printf("%s: HelenOS input service\n", NAME);
    640663       
     
    667690        }
    668691       
    669         char kbd[LOC_NAME_MAXLEN + 1];
    670         snprintf(kbd, LOC_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME);
    671        
    672692        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);
     693        rc = loc_service_register(argv[1], &service_id);
     694        if (rc != EOK) {
     695                printf("%s: Unable to register service %s\n", NAME, argv[1]);
    676696                return rc;
    677697        }
     
    681701       
    682702        printf("%s: Accepting connections\n", NAME);
     703        task_retval(0);
    683704        async_manager();
    684705       
Note: See TracChangeset for help on using the changeset viewer.