Changeset 03362fbd in mainline for uspace/srv/hid/input/input.c
- Timestamp:
- 2013-02-09T23:14:45Z (13 years ago)
- 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. - File:
-
- 1 moved
-
uspace/srv/hid/input/input.c (moved) (moved from uspace/srv/hid/input/generic/input.c ) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/input.c
rb5d2e57 r03362fbd 38 38 39 39 #include <adt/list.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 #include <fibril_synch.h> 42 42 #include <ipc/services.h> … … 54 54 #include <io/keycode.h> 55 55 #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 356 #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 65 65 66 66 static layout_ops_t *layout[NUM_LAYOUTS] = { 67 67 &us_qwerty_ops, 68 68 &us_dvorak_ops, 69 &cz_ops 69 &cz_ops, 70 &ar_ops 70 71 }; 71 72 … … 163 164 } 164 165 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 165 173 ev.type = type; 166 174 ev.key = key; … … 189 197 } 190 198 async_exchange_end(exch); 199 } 200 201 /** Mouse pointer has moved in absolute mode. */ 202 void 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 } 191 210 } 192 211 … … 412 431 kbd_add_dev(&chardev_port, &stty_ctl); 413 432 #endif 414 #if defined(UARCH_arm32) && defined(MACHINE_testarm) && defined(CONFIG_FB)415 kbd_add_dev(&gxemul_port, &gxe_fb_ctl);416 #endif417 #if defined(UARCH_arm32) && defined(MACHINE_testarm) && !defined(CONFIG_FB)418 kbd_add_dev(&gxemul_port, &stty_ctl);419 #endif420 433 #if defined(UARCH_arm32) && defined(MACHINE_integratorcp) 421 434 kbd_add_dev(&pl050_port, &pc_ctl); … … 635 648 } 636 649 650 static void usage(char *name) 651 { 652 printf("Usage: %s <service_name>\n", name); 653 } 654 637 655 int main(int argc, char **argv) 638 656 { 657 if (argc < 2) { 658 usage(argv[0]); 659 return 1; 660 } 661 639 662 printf("%s: HelenOS input service\n", NAME); 640 663 … … 667 690 } 668 691 669 char kbd[LOC_NAME_MAXLEN + 1];670 snprintf(kbd, LOC_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME);671 672 692 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]); 676 696 return rc; 677 697 } … … 681 701 682 702 printf("%s: Accepting connections\n", NAME); 703 task_retval(0); 683 704 async_manager(); 684 705
Note:
See TracChangeset
for help on using the changeset viewer.
