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