Changeset 4c53333 in mainline for uspace/srv/hid/input/input.c
- Timestamp:
- 2013-07-11T08:21:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 64e63ce1
- Parents:
- 80445cf (diff), c8bb1633 (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
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/input.c
r80445cf r4c53333 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); … … 426 439 #if defined(MACHINE_msim) 427 440 kbd_add_dev(&msim_port, &stty_ctl); 428 #endif429 #if (defined(MACHINE_lgxemul) || defined(MACHINE_bgxemul)) && defined(CONFIG_FB)430 kbd_add_dev(&gxemul_port, &gxe_fb_ctl);431 #endif432 #if defined(MACHINE_lgxemul) || defined(MACHINE_bgxemul) && !defined(CONFIG_FB)433 kbd_add_dev(&gxemul_port, &stty_ctl);434 441 #endif 435 442 #if defined(UARCH_ppc32) … … 635 642 } 636 643 644 static void usage(char *name) 645 { 646 printf("Usage: %s <service_name>\n", name); 647 } 648 637 649 int main(int argc, char **argv) 638 650 { 651 if (argc < 2) { 652 usage(argv[0]); 653 return 1; 654 } 655 639 656 printf("%s: HelenOS input service\n", NAME); 640 657 … … 662 679 async_set_client_connection(client_connection); 663 680 int rc = loc_server_register(NAME); 664 if (rc < 0) { 665 printf("%s: Unable to register server (%d)\n", NAME, rc); 666 return -1; 667 } 668 669 char kbd[LOC_NAME_MAXLEN + 1]; 670 snprintf(kbd, LOC_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME); 681 if (rc != EOK) { 682 printf("%s: Unable to register server\n", NAME); 683 return rc; 684 } 671 685 672 686 service_id_t service_id; 673 if (loc_service_register(kbd, &service_id) != EOK) { 674 printf("%s: Unable to register service %s\n", NAME, kbd); 675 return -1; 687 rc = loc_service_register(argv[1], &service_id); 688 if (rc != EOK) { 689 printf("%s: Unable to register service %s\n", NAME, argv[1]); 690 return rc; 676 691 } 677 692 … … 680 695 681 696 printf("%s: Accepting connections\n", NAME); 697 task_retval(0); 682 698 async_manager(); 683 699
Note:
See TracChangeset
for help on using the changeset viewer.