Changes in uspace/srv/hid/display/input.c [88d828e:78445be8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/input.c
r88d828e r78445be8 1 1 /* 2 * Copyright (c) 20 22Jiri Svoboda2 * Copyright (c) 2019 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 34 34 35 35 #include <errno.h> 36 #include <inttypes.h>37 36 #include <io/input.h> 38 37 #include <io/log.h> … … 45 44 static errno_t ds_input_ev_active(input_t *); 46 45 static errno_t ds_input_ev_deactive(input_t *); 47 static errno_t ds_input_ev_key(input_t *, unsigned, kbd_event_type_t, keycode_t, 48 keymod_t, char32_t); 49 static errno_t ds_input_ev_move(input_t *, unsigned, int, int); 50 static errno_t ds_input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, 51 unsigned, unsigned); 52 static errno_t ds_input_ev_button(input_t *, unsigned, int, int); 53 static errno_t ds_input_ev_dclick(input_t *, unsigned, int); 46 static errno_t ds_input_ev_key(input_t *, kbd_event_type_t, keycode_t, keymod_t, wchar_t); 47 static errno_t ds_input_ev_move(input_t *, int, int); 48 static errno_t ds_input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, unsigned); 49 static errno_t ds_input_ev_button(input_t *, int, int); 54 50 55 51 static input_ev_ops_t ds_input_ev_ops = { … … 59 55 .move = ds_input_ev_move, 60 56 .abs_move = ds_input_ev_abs_move, 61 .button = ds_input_ev_button, 62 .dclick = ds_input_ev_dclick 57 .button = ds_input_ev_button 63 58 }; 64 59 … … 73 68 } 74 69 75 static errno_t ds_input_ev_key(input_t *input, unsigned kbd_id,76 k bd_event_type_t type, keycode_t key, keymod_t mods, char32_t c)70 static errno_t ds_input_ev_key(input_t *input, kbd_event_type_t type, 71 keycode_t key, keymod_t mods, wchar_t c) 77 72 { 78 73 ds_display_t *disp = (ds_display_t *) input->user; … … 80 75 errno_t rc; 81 76 82 event.kbd_id = kbd_id;83 77 event.type = type; 84 78 event.key = key; … … 92 86 } 93 87 94 static errno_t ds_input_ev_move(input_t *input, unsigned pos_id,int dx, int dy)88 static errno_t ds_input_ev_move(input_t *input, int dx, int dy) 95 89 { 96 90 ds_display_t *disp = (ds_display_t *) input->user; … … 98 92 errno_t rc; 99 93 100 event.pos_id = pos_id;101 94 event.type = PTD_MOVE; 102 95 event.dmove.x = dx; … … 109 102 } 110 103 111 static errno_t ds_input_ev_abs_move(input_t *input, unsigned pos_id, unsigned x,112 unsigned y, unsignedmax_x, unsigned max_y)104 static errno_t ds_input_ev_abs_move(input_t *input, unsigned x, unsigned y, 105 unsigned max_x, unsigned max_y) 113 106 { 114 107 ds_display_t *disp = (ds_display_t *) input->user; … … 116 109 errno_t rc; 117 110 118 event.pos_id = pos_id;119 111 event.type = PTD_ABS_MOVE; 120 112 event.apos.x = x; … … 131 123 } 132 124 133 static errno_t ds_input_ev_button(input_t *input, unsigned pos_id, int bnum, 134 int bpress) 125 static errno_t ds_input_ev_button(input_t *input, int bnum, int bpress) 135 126 { 136 127 ds_display_t *disp = (ds_display_t *) input->user; … … 138 129 errno_t rc; 139 130 140 event.pos_id = pos_id;141 131 event.type = bpress ? PTD_PRESS : PTD_RELEASE; 142 event.btn_num = bnum;143 event.dmove.x = 0;144 event.dmove.y = 0;145 146 ds_display_lock(disp);147 rc = ds_display_post_ptd_event(disp, &event);148 ds_display_unlock(disp);149 return rc;150 }151 152 static errno_t ds_input_ev_dclick(input_t *input, unsigned pos_id, int bnum)153 {154 ds_display_t *disp = (ds_display_t *) input->user;155 ptd_event_t event;156 errno_t rc;157 158 event.pos_id = pos_id;159 event.type = PTD_DCLICK;160 132 event.btn_num = bnum; 161 133 event.dmove.x = 0;
Note:
See TracChangeset
for help on using the changeset viewer.