Changes in uspace/srv/hid/display/input.c [6fbd1f9:78445be8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/input.c
r6fbd1f9 r78445be8 1 1 /* 2 * Copyright (c) 20 24Jiri 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> … … 40 39 #include <str_error.h> 41 40 #include "display.h" 42 #include "ievent.h"43 41 #include "input.h" 44 42 #include "main.h" … … 46 44 static errno_t ds_input_ev_active(input_t *); 47 45 static errno_t ds_input_ev_deactive(input_t *); 48 static errno_t ds_input_ev_key(input_t *, unsigned, kbd_event_type_t, keycode_t, 49 keymod_t, char32_t); 50 static errno_t ds_input_ev_move(input_t *, unsigned, int, int); 51 static errno_t ds_input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, 52 unsigned, unsigned); 53 static errno_t ds_input_ev_button(input_t *, unsigned, int, int); 54 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); 55 50 56 51 static input_ev_ops_t ds_input_ev_ops = { … … 60 55 .move = ds_input_ev_move, 61 56 .abs_move = ds_input_ev_abs_move, 62 .button = ds_input_ev_button, 63 .dclick = ds_input_ev_dclick 57 .button = ds_input_ev_button 64 58 }; 65 59 … … 74 68 } 75 69 76 static errno_t ds_input_ev_key(input_t *input, unsigned kbd_id,77 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) 78 72 { 79 73 ds_display_t *disp = (ds_display_t *) input->user; … … 81 75 errno_t rc; 82 76 83 event.kbd_id = kbd_id;84 77 event.type = type; 85 78 event.key = key; … … 88 81 89 82 ds_display_lock(disp); 90 rc = ds_ ievent_post_kbd(disp, &event);83 rc = ds_display_post_kbd_event(disp, &event); 91 84 ds_display_unlock(disp); 92 85 return rc; 93 86 } 94 87 95 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) 96 89 { 97 90 ds_display_t *disp = (ds_display_t *) input->user; … … 99 92 errno_t rc; 100 93 101 event.pos_id = pos_id;102 94 event.type = PTD_MOVE; 103 95 event.dmove.x = dx; … … 105 97 106 98 ds_display_lock(disp); 107 rc = ds_ ievent_post_ptd(disp, &event);99 rc = ds_display_post_ptd_event(disp, &event); 108 100 ds_display_unlock(disp); 109 101 return rc; 110 102 } 111 103 112 static errno_t ds_input_ev_abs_move(input_t *input, unsigned pos_id, unsigned x,113 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) 114 106 { 115 107 ds_display_t *disp = (ds_display_t *) input->user; … … 117 109 errno_t rc; 118 110 119 event.pos_id = pos_id;120 111 event.type = PTD_ABS_MOVE; 121 112 event.apos.x = x; … … 127 118 128 119 ds_display_lock(disp); 129 rc = ds_ ievent_post_ptd(disp, &event);120 rc = ds_display_post_ptd_event(disp, &event); 130 121 ds_display_unlock(disp); 131 122 return rc; 132 123 } 133 124 134 static errno_t ds_input_ev_button(input_t *input, unsigned pos_id, int bnum, 135 int bpress) 125 static errno_t ds_input_ev_button(input_t *input, int bnum, int bpress) 136 126 { 137 127 ds_display_t *disp = (ds_display_t *) input->user; … … 139 129 errno_t rc; 140 130 141 event.pos_id = pos_id;142 131 event.type = bpress ? PTD_PRESS : PTD_RELEASE; 143 132 event.btn_num = bnum; … … 146 135 147 136 ds_display_lock(disp); 148 rc = ds_ievent_post_ptd(disp, &event); 149 ds_display_unlock(disp); 150 return rc; 151 } 152 153 static errno_t ds_input_ev_dclick(input_t *input, unsigned pos_id, int bnum) 154 { 155 ds_display_t *disp = (ds_display_t *) input->user; 156 ptd_event_t event; 157 errno_t rc; 158 159 event.pos_id = pos_id; 160 event.type = PTD_DCLICK; 161 event.btn_num = bnum; 162 event.dmove.x = 0; 163 event.dmove.y = 0; 164 165 ds_display_lock(disp); 166 rc = ds_ievent_post_ptd(disp, &event); 137 rc = ds_display_post_ptd_event(disp, &event); 167 138 ds_display_unlock(disp); 168 139 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.