summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-06-05 12:03:29 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-06-05 12:07:57 -0700
commitf3370549d24ec015c68b0545a284a724fe17c1e3 (patch)
tree9ffa34d8cb0d00af4829bdf78e5513a88b6d8742 /src/modules/ecore_evas
parentfd38c097359048e980ad81817b9756197e6ce1fa (diff)
ecore_evas: reuse code by relying on switch case statement fallthrough for key offset case.
Diffstat (limited to 'src/modules/ecore_evas')
-rw-r--r--src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c b/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c
index 4193f1d..393693c 100644
--- a/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c
+++ b/src/modules/ecore_evas/vnc_server/ecore_evas_vnc_server_fb_keymap.c
@@ -34,14 +34,17 @@ _x11_to_fb(rfbKeySym key, unsigned int *offset)
34 return KEY_KPSLASH; 34 return KEY_KPSLASH;
35 case XK_plus: 35 case XK_plus:
36 *offset = 1; 36 *offset = 1;
37 EINA_FALLTHROUGH;
37 case XK_equal: 38 case XK_equal:
38 return KEY_EQUAL; 39 return KEY_EQUAL;
39 case XK_underscore: 40 case XK_underscore:
40 *offset = 1; 41 *offset = 1;
42 EINA_FALLTHROUGH;
41 case XK_minus: 43 case XK_minus:
42 return KEY_MINUS; 44 return KEY_MINUS;
43 case XK_quotedbl: 45 case XK_quotedbl:
44 *offset = 1; 46 *offset = 1;
47 EINA_FALLTHROUGH;
45 case XK_apostrophe: 48 case XK_apostrophe:
46 return KEY_APOSTROPHE; 49 return KEY_APOSTROPHE;
47 case XK_Shift_L: 50 case XK_Shift_L:
@@ -66,14 +69,17 @@ _x11_to_fb(rfbKeySym key, unsigned int *offset)
66 return KEY_SPACE; 69 return KEY_SPACE;
67 case XK_period: 70 case XK_period:
68 *offset = 1; 71 *offset = 1;
72 EINA_FALLTHROUGH;
69 case XK_greater: 73 case XK_greater:
70 return KEY_DOT; 74 return KEY_DOT;
71 case XK_bar: 75 case XK_bar:
72 *offset = 1; 76 *offset = 1;
77 EINA_FALLTHROUGH;
73 case XK_backslash: 78 case XK_backslash:
74 return KEY_BACKSLASH; 79 return KEY_BACKSLASH;
75 case XK_question: 80 case XK_question:
76 *offset = 1; 81 *offset = 1;
82 EINA_FALLTHROUGH;
77 case XK_slash: 83 case XK_slash:
78 return KEY_SLASH; 84 return KEY_SLASH;
79 case XK_braceleft: 85 case XK_braceleft:
@@ -84,14 +90,17 @@ _x11_to_fb(rfbKeySym key, unsigned int *offset)
84 return KEY_RIGHTBRACE; 90 return KEY_RIGHTBRACE;
85 case XK_colon: 91 case XK_colon:
86 *offset = 1; 92 *offset = 1;
93 EINA_FALLTHROUGH;
87 case XK_semicolon: 94 case XK_semicolon:
88 return KEY_SEMICOLON; 95 return KEY_SEMICOLON;
89 case XK_asciitilde: 96 case XK_asciitilde:
90 *offset = 1; 97 *offset = 1;
98 EINA_FALLTHROUGH;
91 case XK_grave: 99 case XK_grave:
92 return KEY_GRAVE; 100 return KEY_GRAVE;
93 case XK_less: 101 case XK_less:
94 *offset = 1; 102 *offset = 1;
103 EINA_FALLTHROUGH;
95 case XK_comma: 104 case XK_comma:
96 return KEY_COMMA; 105 return KEY_COMMA;
97 case XK_F1: 106 case XK_F1:
@@ -154,188 +163,234 @@ _x11_to_fb(rfbKeySym key, unsigned int *offset)
154 return KEY_END; 163 return KEY_END;
155 case XK_KP_0: 164 case XK_KP_0:
156 *offset = 1; 165 *offset = 1;
166 EINA_FALLTHROUGH;
157 case XK_KP_Insert: 167 case XK_KP_Insert:
158 return KEY_KP0; 168 return KEY_KP0;
159 case XK_KP_1: 169 case XK_KP_1:
160 *offset = 1; 170 *offset = 1;
171 EINA_FALLTHROUGH;
161 case XK_KP_End: 172 case XK_KP_End:
162 return KEY_KP1; 173 return KEY_KP1;
163 case XK_KP_2: 174 case XK_KP_2:
164 *offset = 1; 175 *offset = 1;
176 EINA_FALLTHROUGH;
165 case XK_KP_Down: 177 case XK_KP_Down:
166 return KEY_KP2; 178 return KEY_KP2;
167 case XK_KP_3: 179 case XK_KP_3:
168 *offset = 1; 180 *offset = 1;
181 EINA_FALLTHROUGH;
169 case XK_KP_Next: 182 case XK_KP_Next:
170 return KEY_KP3; 183 return KEY_KP3;
171 case XK_KP_4: 184 case XK_KP_4:
172 *offset = 1; 185 *offset = 1;
186 EINA_FALLTHROUGH;
173 case XK_KP_Left: 187 case XK_KP_Left:
174 return KEY_KP4; 188 return KEY_KP4;
175 case XK_KP_5: 189 case XK_KP_5:
176 *offset = 1; 190 *offset = 1;
191 EINA_FALLTHROUGH;
177 case XK_KP_Begin: 192 case XK_KP_Begin:
178 return KEY_KP5; 193 return KEY_KP5;
179 case XK_KP_6: 194 case XK_KP_6:
180 *offset = 1; 195 *offset = 1;
196 EINA_FALLTHROUGH;
181 case XK_KP_Right: 197 case XK_KP_Right:
182 return KEY_KP6; 198 return KEY_KP6;
183 case XK_KP_7: 199 case XK_KP_7:
184 *offset = 1; 200 *offset = 1;
201 EINA_FALLTHROUGH;
185 case XK_KP_Home: 202 case XK_KP_Home:
186 return KEY_KP7; 203 return KEY_KP7;
187 case XK_KP_8: 204 case XK_KP_8:
188 *offset = 1; 205 *offset = 1;
206 EINA_FALLTHROUGH;
189 case XK_KP_Up: 207 case XK_KP_Up:
190 return KEY_KP8; 208 return KEY_KP8;
191 case XK_KP_9: 209 case XK_KP_9:
192 *offset = 1; 210 *offset = 1;
211 EINA_FALLTHROUGH;
193 case XK_KP_Prior: 212 case XK_KP_Prior:
194 return KEY_KP9; 213 return KEY_KP9;
195 case XK_KP_Enter: 214 case XK_KP_Enter:
196 return KEY_KPENTER; 215 return KEY_KPENTER;
197 case XK_parenright: 216 case XK_parenright:
198 *offset = 1; 217 *offset = 1;
218 EINA_FALLTHROUGH;
199 case XK_0: 219 case XK_0:
200 return KEY_0; 220 return KEY_0;
201 case XK_exclam: 221 case XK_exclam:
202 *offset = 1; 222 *offset = 1;
223 EINA_FALLTHROUGH;
203 case XK_1: 224 case XK_1:
204 return KEY_1; 225 return KEY_1;
205 case XK_at: 226 case XK_at:
206 *offset = 1; 227 *offset = 1;
228 EINA_FALLTHROUGH;
207 case XK_2: 229 case XK_2:
208 return KEY_2; 230 return KEY_2;
209 case XK_numbersign: 231 case XK_numbersign:
210 *offset = 1; 232 *offset = 1;
233 EINA_FALLTHROUGH;
211 case XK_3: 234 case XK_3:
212 return KEY_3; 235 return KEY_3;
213 case XK_dollar: 236 case XK_dollar:
214 *offset = 1; 237 *offset = 1;
238 EINA_FALLTHROUGH;
215 case XK_4: 239 case XK_4:
216 return KEY_4; 240 return KEY_4;
217 case XK_percent: 241 case XK_percent:
218 *offset = 1; 242 *offset = 1;
243 EINA_FALLTHROUGH;
219 case XK_5: 244 case XK_5:
220 return KEY_5; 245 return KEY_5;
221 case XK_asciicircum: 246 case XK_asciicircum:
222 *offset = 1; 247 *offset = 1;
248 EINA_FALLTHROUGH;
223 case XK_6: 249 case XK_6:
224 return KEY_6; 250 return KEY_6;
225 case XK_ampersand: 251 case XK_ampersand:
226 *offset = 1; 252 *offset = 1;
253 EINA_FALLTHROUGH;
227 case XK_7: 254 case XK_7:
228 return KEY_7; 255 return KEY_7;
229 case XK_asterisk: 256 case XK_asterisk:
230 *offset = 1; 257 *offset = 1;
258 EINA_FALLTHROUGH;
231 case XK_8: 259 case XK_8:
232 return KEY_8; 260 return KEY_8;
233 case XK_parenleft: 261 case XK_parenleft:
234 *offset = 1; 262 *offset = 1;
263 EINA_FALLTHROUGH;
235 case XK_9: 264 case XK_9:
236 return KEY_9; 265 return KEY_9;
237 case XK_A: 266 case XK_A:
238 *offset = 1; 267 *offset = 1;
268 EINA_FALLTHROUGH;
239 case XK_a: 269 case XK_a:
240 return KEY_A; 270 return KEY_A;
241 case XK_B: 271 case XK_B:
242 *offset = 1; 272 *offset = 1;
273 EINA_FALLTHROUGH;
243 case XK_b: 274 case XK_b:
244 return KEY_B; 275 return KEY_B;
245 case XK_C: 276 case XK_C:
246 *offset = 1; 277 *offset = 1;
278 EINA_FALLTHROUGH;
247 case XK_c: 279 case XK_c:
248 return KEY_C; 280 return KEY_C;
249 case XK_D: 281 case XK_D:
250 *offset = 1; 282 *offset = 1;
283 EINA_FALLTHROUGH;
251 case XK_d: 284 case XK_d:
252 return KEY_D; 285 return KEY_D;
253 case XK_E: 286 case XK_E:
254 *offset = 1; 287 *offset = 1;
288 EINA_FALLTHROUGH;
255 case XK_e: 289 case XK_e:
256 return KEY_E; 290 return KEY_E;
257 case XK_F: 291 case XK_F:
258 *offset = 1; 292 *offset = 1;
293 EINA_FALLTHROUGH;
259 case XK_f: 294 case XK_f:
260 return KEY_F; 295 return KEY_F;
261 case XK_G: 296 case XK_G:
262 *offset = 1; 297 *offset = 1;
298 EINA_FALLTHROUGH;
263 case XK_g: 299 case XK_g:
264 return KEY_G; 300 return KEY_G;
265 case XK_H: 301 case XK_H:
266 *offset = 1; 302 *offset = 1;
303 EINA_FALLTHROUGH;
267 case XK_h: 304 case XK_h:
268 return KEY_H; 305 return KEY_H;
269 case XK_I: 306 case XK_I:
270 *offset = 1; 307 *offset = 1;
308 EINA_FALLTHROUGH;
271 case XK_i: 309 case XK_i:
272 return KEY_I; 310 return KEY_I;
273 case XK_J: 311 case XK_J:
274 *offset = 1; 312 *offset = 1;
313 EINA_FALLTHROUGH;
275 case XK_j: 314 case XK_j:
276 return KEY_J; 315 return KEY_J;
277 case XK_K: 316 case XK_K:
278 *offset = 1; 317 *offset = 1;
318 EINA_FALLTHROUGH;
279 case XK_k: 319 case XK_k:
280 return KEY_K; 320 return KEY_K;
281 case XK_L: 321 case XK_L:
282 *offset = 1; 322 *offset = 1;
323 EINA_FALLTHROUGH;
283 case XK_l: 324 case XK_l:
284 return KEY_L; 325 return KEY_L;
285 case XK_M: 326 case XK_M:
286 *offset = 1; 327 *offset = 1;
328 EINA_FALLTHROUGH;
287 case XK_m: 329 case XK_m:
288 return KEY_M; 330 return KEY_M;
289 case XK_N: 331 case XK_N:
290 *offset = 1; 332 *offset = 1;
333 EINA_FALLTHROUGH;
291 case XK_n: 334 case XK_n:
292 return KEY_N; 335 return KEY_N;
293 case XK_O: 336 case XK_O:
294 *offset = 1; 337 *offset = 1;
338 EINA_FALLTHROUGH;
295 case XK_o: 339 case XK_o:
296 return KEY_O; 340 return KEY_O;
297 case XK_P: 341 case XK_P:
298 *offset = 1; 342 *offset = 1;
343 EINA_FALLTHROUGH;
299 case XK_p: 344 case XK_p:
300 return KEY_P; 345 return KEY_P;
301 case XK_Q: 346 case XK_Q:
302 *offset = 1; 347 *offset = 1;
348 EINA_FALLTHROUGH;
303 case XK_q: 349 case XK_q:
304 return KEY_Q; 350 return KEY_Q;
305 case XK_R: 351 case XK_R:
306 *offset = 1; 352 *offset = 1;
353 EINA_FALLTHROUGH;
307 case XK_r: 354 case XK_r:
308 return KEY_R; 355 return KEY_R;
309 case XK_S: 356 case XK_S:
310 *offset = 1; 357 *offset = 1;
358 EINA_FALLTHROUGH;
311 case XK_s: 359 case XK_s:
312 return KEY_S; 360 return KEY_S;
313 case XK_T: 361 case XK_T:
314 *offset = 1; 362 *offset = 1;
363 EINA_FALLTHROUGH;
315 case XK_t: 364 case XK_t:
316 return KEY_T; 365 return KEY_T;
317 case XK_U: 366 case XK_U:
318 *offset = 1; 367 *offset = 1;
368 EINA_FALLTHROUGH;
319 case XK_u: 369 case XK_u:
320 return KEY_U; 370 return KEY_U;
321 case XK_V: 371 case XK_V:
322 *offset = 1; 372 *offset = 1;
373 EINA_FALLTHROUGH;
323 case XK_v: 374 case XK_v:
324 return KEY_V; 375 return KEY_V;
325 case XK_W: 376 case XK_W:
326 *offset = 1; 377 *offset = 1;
378 EINA_FALLTHROUGH;
327 case XK_w: 379 case XK_w:
328 return KEY_W; 380 return KEY_W;
329 case XK_X: 381 case XK_X:
330 *offset = 1; 382 *offset = 1;
383 EINA_FALLTHROUGH;
331 case XK_x: 384 case XK_x:
332 return KEY_X; 385 return KEY_X;
333 case XK_Y: 386 case XK_Y:
334 *offset = 1; 387 *offset = 1;
388 EINA_FALLTHROUGH;
335 case XK_y: 389 case XK_y:
336 return KEY_Y; 390 return KEY_Y;
337 case XK_Z: 391 case XK_Z:
338 *offset = 1; 392 *offset = 1;
393 EINA_FALLTHROUGH;
339 case XK_z: 394 case XK_z:
340 return KEY_Z; 395 return KEY_Z;
341 default: 396 default: