diff options
Diffstat (limited to 'firmware/target/hosted/sdl/button-sdl.c')
-rw-r--r-- | firmware/target/hosted/sdl/button-sdl.c | 1670 |
1 files changed, 11 insertions, 1659 deletions
diff --git a/firmware/target/hosted/sdl/button-sdl.c b/firmware/target/hosted/sdl/button-sdl.c index 20dcf6349d..2f971d7a4e 100644 --- a/firmware/target/hosted/sdl/button-sdl.c +++ b/firmware/target/hosted/sdl/button-sdl.c | |||
@@ -29,10 +29,12 @@ | |||
29 | #include "kernel.h" | 29 | #include "kernel.h" |
30 | #include "backlight.h" | 30 | #include "backlight.h" |
31 | #include "misc.h" | 31 | #include "misc.h" |
32 | #include "sim_tasks.h" | ||
33 | #include "button-sdl.h" | 32 | #include "button-sdl.h" |
34 | #include "backlight.h" | 33 | #include "backlight.h" |
35 | 34 | #ifdef SIMULATOR | |
35 | #include "sim_tasks.h" | ||
36 | #include "buttonmap.h" | ||
37 | #endif | ||
36 | #include "debug.h" | 38 | #include "debug.h" |
37 | 39 | ||
38 | #ifdef HAVE_TOUCHSCREEN | 40 | #ifdef HAVE_TOUCHSCREEN |
@@ -63,8 +65,6 @@ int remote_type(void) | |||
63 | } | 65 | } |
64 | #endif | 66 | #endif |
65 | 67 | ||
66 | static int xy2button(int x, int y); | ||
67 | |||
68 | struct event_queue button_queue; | 68 | struct event_queue button_queue; |
69 | 69 | ||
70 | static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ | 70 | static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ |
@@ -196,77 +196,6 @@ static void button_event(int key, bool pressed) | |||
196 | return; | 196 | return; |
197 | switch (key) | 197 | switch (key) |
198 | { | 198 | { |
199 | |||
200 | #ifdef HAVE_TOUCHSCREEN | ||
201 | case BUTTON_TOUCHSCREEN: | ||
202 | switch (touchscreen_get_mode()) | ||
203 | { | ||
204 | case TOUCHSCREEN_POINT: | ||
205 | new_btn = BUTTON_TOUCHSCREEN; | ||
206 | break; | ||
207 | case TOUCHSCREEN_BUTTON: | ||
208 | { | ||
209 | static int touchscreen_buttons[3][3] = { | ||
210 | {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT}, | ||
211 | {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT}, | ||
212 | {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT}, | ||
213 | }; | ||
214 | int px_x = ((mouse_coords&0xffff0000)>>16); | ||
215 | int px_y = ((mouse_coords&0x0000ffff)); | ||
216 | new_btn = touchscreen_buttons[px_y/(LCD_HEIGHT/3)][px_x/(LCD_WIDTH/3)]; | ||
217 | break; | ||
218 | } | ||
219 | } | ||
220 | break; | ||
221 | case SDLK_KP7: | ||
222 | case SDLK_7: | ||
223 | new_btn = BUTTON_TOPLEFT; | ||
224 | break; | ||
225 | case SDLK_KP8: | ||
226 | case SDLK_8: | ||
227 | case SDLK_UP: | ||
228 | new_btn = BUTTON_TOPMIDDLE; | ||
229 | break; | ||
230 | case SDLK_KP9: | ||
231 | case SDLK_9: | ||
232 | new_btn = BUTTON_TOPRIGHT; | ||
233 | break; | ||
234 | case SDLK_KP4: | ||
235 | case SDLK_u: | ||
236 | case SDLK_LEFT: | ||
237 | new_btn = BUTTON_MIDLEFT; | ||
238 | break; | ||
239 | case SDLK_KP5: | ||
240 | case SDLK_i: | ||
241 | new_btn = BUTTON_CENTER; | ||
242 | break; | ||
243 | case SDLK_KP6: | ||
244 | case SDLK_o: | ||
245 | case SDLK_RIGHT: | ||
246 | new_btn = BUTTON_MIDRIGHT; | ||
247 | break; | ||
248 | case SDLK_KP1: | ||
249 | case SDLK_j: | ||
250 | new_btn = BUTTON_BOTTOMLEFT; | ||
251 | break; | ||
252 | case SDLK_KP2: | ||
253 | case SDLK_k: | ||
254 | case SDLK_DOWN: | ||
255 | new_btn = BUTTON_BOTTOMMIDDLE; | ||
256 | break; | ||
257 | case SDLK_KP3: | ||
258 | case SDLK_l: | ||
259 | new_btn = BUTTON_BOTTOMRIGHT; | ||
260 | break; | ||
261 | case SDLK_F4: | ||
262 | if(pressed) | ||
263 | { | ||
264 | touchscreen_set_mode(touchscreen_get_mode() == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); | ||
265 | printf("Touchscreen mode: %s\n", touchscreen_get_mode() == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); | ||
266 | } | ||
267 | break; | ||
268 | |||
269 | #endif | ||
270 | case USB_KEY: | 199 | case USB_KEY: |
271 | if (!pressed) | 200 | if (!pressed) |
272 | { | 201 | { |
@@ -298,1116 +227,7 @@ static void button_event(int key, bool pressed) | |||
298 | } | 227 | } |
299 | return; | 228 | return; |
300 | #endif | 229 | #endif |
301 | |||
302 | #if CONFIG_KEYPAD == GIGABEAT_PAD | ||
303 | case SDLK_KP4: | ||
304 | case SDLK_LEFT: | ||
305 | new_btn = BUTTON_LEFT; | ||
306 | break; | ||
307 | case SDLK_KP6: | ||
308 | case SDLK_RIGHT: | ||
309 | new_btn = BUTTON_RIGHT; | ||
310 | break; | ||
311 | case SDLK_KP8: | ||
312 | case SDLK_UP: | ||
313 | new_btn = BUTTON_UP; | ||
314 | break; | ||
315 | case SDLK_KP2: | ||
316 | case SDLK_DOWN: | ||
317 | new_btn = BUTTON_DOWN; | ||
318 | break; | ||
319 | case SDLK_KP_PLUS: | ||
320 | case SDLK_F8: | ||
321 | new_btn = BUTTON_POWER; | ||
322 | break; | ||
323 | case SDLK_ESCAPE: | ||
324 | new_btn = BUTTON_POWER; | ||
325 | break; | ||
326 | case SDLK_KP_ENTER: | ||
327 | case SDLK_RETURN: | ||
328 | case SDLK_a: | ||
329 | new_btn = BUTTON_A; | ||
330 | break; | ||
331 | case SDLK_KP5: | ||
332 | case SDLK_SPACE: | ||
333 | new_btn = BUTTON_SELECT; | ||
334 | break; | ||
335 | case SDLK_KP_PERIOD: | ||
336 | case SDLK_INSERT: | ||
337 | new_btn = BUTTON_MENU; | ||
338 | break; | ||
339 | case SDLK_KP9: | ||
340 | new_btn = BUTTON_VOL_UP; | ||
341 | break; | ||
342 | case SDLK_KP3: | ||
343 | new_btn = BUTTON_VOL_DOWN; | ||
344 | break; | ||
345 | |||
346 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD | ||
347 | case SDLK_KP4: | ||
348 | case SDLK_LEFT: | ||
349 | new_btn = BUTTON_LEFT; | ||
350 | break; | ||
351 | case SDLK_KP6: | ||
352 | case SDLK_RIGHT: | ||
353 | new_btn = BUTTON_RIGHT; | ||
354 | break; | ||
355 | case SDLK_KP8: | ||
356 | case SDLK_UP: | ||
357 | new_btn = BUTTON_UP; | ||
358 | break; | ||
359 | case SDLK_KP2: | ||
360 | case SDLK_DOWN: | ||
361 | new_btn = BUTTON_DOWN; | ||
362 | break; | ||
363 | case SDLK_F8: | ||
364 | case SDLK_ESCAPE: | ||
365 | new_btn = BUTTON_POWER; | ||
366 | break; | ||
367 | case SDLK_KP_PLUS: | ||
368 | case SDLK_KP_ENTER: | ||
369 | case SDLK_RETURN: | ||
370 | new_btn = BUTTON_PLAY; | ||
371 | break; | ||
372 | case SDLK_KP7: | ||
373 | new_btn = BUTTON_BACK; | ||
374 | break; | ||
375 | case SDLK_KP5: | ||
376 | case SDLK_SPACE: | ||
377 | new_btn = BUTTON_SELECT; | ||
378 | break; | ||
379 | case SDLK_KP9: | ||
380 | case SDLK_KP_PERIOD: | ||
381 | case SDLK_INSERT: | ||
382 | new_btn = BUTTON_MENU; | ||
383 | break; | ||
384 | |||
385 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD | ||
386 | case SDLK_KP4: | ||
387 | case SDLK_LEFT: | ||
388 | new_btn = BUTTON_LEFT; | ||
389 | break; | ||
390 | case SDLK_KP6: | ||
391 | case SDLK_RIGHT: | ||
392 | new_btn = BUTTON_RIGHT; | ||
393 | break; | ||
394 | case SDLK_KP8: | ||
395 | case SDLK_UP: | ||
396 | new_btn = BUTTON_UP; | ||
397 | break; | ||
398 | case SDLK_KP2: | ||
399 | case SDLK_DOWN: | ||
400 | new_btn = BUTTON_DOWN; | ||
401 | break; | ||
402 | case SDLK_KP_PLUS: | ||
403 | case SDLK_F8: | ||
404 | new_btn = BUTTON_PLAY; | ||
405 | break; | ||
406 | case SDLK_ESCAPE: | ||
407 | new_btn = BUTTON_POWER; | ||
408 | break; | ||
409 | case SDLK_KP_ENTER: | ||
410 | case SDLK_RETURN: | ||
411 | case SDLK_a: | ||
412 | new_btn = BUTTON_POWER; | ||
413 | break; | ||
414 | case SDLK_KP_DIVIDE: | ||
415 | case SDLK_F1: | ||
416 | new_btn = BUTTON_REC; | ||
417 | break; | ||
418 | case SDLK_KP5: | ||
419 | case SDLK_SPACE: | ||
420 | new_btn = BUTTON_SELECT; | ||
421 | break; | ||
422 | |||
423 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | ||
424 | case SDLK_KP4: | ||
425 | new_btn = BUTTON_LEFT; | ||
426 | break; | ||
427 | case SDLK_LEFT: | ||
428 | new_btn = BUTTON_RC_REW; | ||
429 | break; | ||
430 | case SDLK_KP6: | ||
431 | new_btn = BUTTON_RIGHT; | ||
432 | break; | ||
433 | case SDLK_RIGHT: | ||
434 | new_btn = BUTTON_RC_FF; | ||
435 | break; | ||
436 | case SDLK_KP8: | ||
437 | new_btn = BUTTON_VOL_UP; | ||
438 | break; | ||
439 | case SDLK_UP: | ||
440 | new_btn = BUTTON_RC_VOL_UP; | ||
441 | break; | ||
442 | case SDLK_KP2: | ||
443 | new_btn = BUTTON_VOL_DOWN; | ||
444 | break; | ||
445 | case SDLK_DOWN: | ||
446 | new_btn = BUTTON_RC_VOL_DOWN; | ||
447 | break; | ||
448 | case SDLK_KP_PERIOD: | ||
449 | new_btn = BUTTON_MODE; | ||
450 | break; | ||
451 | case SDLK_INSERT: | ||
452 | new_btn = BUTTON_RC_MODE; | ||
453 | break; | ||
454 | case SDLK_KP_DIVIDE: | ||
455 | new_btn = BUTTON_REC; | ||
456 | break; | ||
457 | case SDLK_F1: | ||
458 | new_btn = BUTTON_RC_REC; | ||
459 | break; | ||
460 | case SDLK_KP5: | ||
461 | new_btn = BUTTON_PLAY; | ||
462 | break; | ||
463 | case SDLK_SPACE: | ||
464 | new_btn = BUTTON_RC_PLAY; | ||
465 | break; | ||
466 | case SDLK_KP_ENTER: | ||
467 | case SDLK_RETURN: | ||
468 | new_btn = BUTTON_RC_MENU; | ||
469 | break; | ||
470 | |||
471 | #elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) \ | ||
472 | || (CONFIG_KEYPAD == IPOD_4G_PAD) | ||
473 | case SDLK_KP4: | ||
474 | case SDLK_LEFT: | ||
475 | new_btn = BUTTON_LEFT; | ||
476 | break; | ||
477 | case SDLK_KP6: | ||
478 | case SDLK_RIGHT: | ||
479 | new_btn = BUTTON_RIGHT; | ||
480 | break; | ||
481 | case SDLK_KP8: | ||
482 | case SDLK_UP: | ||
483 | new_btn = BUTTON_SCROLL_BACK; | ||
484 | break; | ||
485 | case SDLK_KP2: | ||
486 | case SDLK_DOWN: | ||
487 | new_btn = BUTTON_SCROLL_FWD; | ||
488 | break; | ||
489 | case SDLK_KP_PLUS: | ||
490 | case SDLK_F8: | ||
491 | new_btn = BUTTON_PLAY; | ||
492 | break; | ||
493 | case SDLK_KP5: | ||
494 | case SDLK_SPACE: | ||
495 | new_btn = BUTTON_SELECT; | ||
496 | break; | ||
497 | case SDLK_KP_PERIOD: | ||
498 | case SDLK_INSERT: | ||
499 | new_btn = BUTTON_MENU; | ||
500 | break; | ||
501 | |||
502 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | ||
503 | case SDLK_KP4: | ||
504 | case SDLK_LEFT: | ||
505 | new_btn = BUTTON_LEFT; | ||
506 | break; | ||
507 | case SDLK_KP6: | ||
508 | case SDLK_RIGHT: | ||
509 | new_btn = BUTTON_RIGHT; | ||
510 | break; | ||
511 | case SDLK_KP8: | ||
512 | case SDLK_UP: | ||
513 | new_btn = BUTTON_SCROLL_UP; | ||
514 | break; | ||
515 | case SDLK_KP2: | ||
516 | case SDLK_DOWN: | ||
517 | new_btn = BUTTON_SCROLL_DOWN; | ||
518 | break; | ||
519 | case SDLK_KP_PLUS: | ||
520 | case SDLK_F8: | ||
521 | new_btn = BUTTON_POWER; | ||
522 | break; | ||
523 | case SDLK_ESCAPE: | ||
524 | new_btn = BUTTON_POWER; | ||
525 | break; | ||
526 | case SDLK_KP_DIVIDE: | ||
527 | case SDLK_F1: | ||
528 | new_btn = BUTTON_REW; | ||
529 | break; | ||
530 | case SDLK_KP_MULTIPLY: | ||
531 | case SDLK_F2: | ||
532 | new_btn = BUTTON_FF; | ||
533 | break; | ||
534 | case SDLK_KP5: | ||
535 | case SDLK_SPACE: | ||
536 | new_btn = BUTTON_PLAY; | ||
537 | break; | ||
538 | |||
539 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
540 | case SDLK_t: | ||
541 | if(pressed) | ||
542 | switch(_remote_type) | ||
543 | { | ||
544 | case REMOTETYPE_UNPLUGGED: | ||
545 | _remote_type=REMOTETYPE_H100_LCD; | ||
546 | DEBUGF("Changed remote type to H100\n"); | ||
547 | break; | ||
548 | case REMOTETYPE_H100_LCD: | ||
549 | _remote_type=REMOTETYPE_H300_LCD; | ||
550 | DEBUGF("Changed remote type to H300\n"); | ||
551 | break; | ||
552 | case REMOTETYPE_H300_LCD: | ||
553 | _remote_type=REMOTETYPE_H300_NONLCD; | ||
554 | DEBUGF("Changed remote type to H300 NON-LCD\n"); | ||
555 | break; | ||
556 | case REMOTETYPE_H300_NONLCD: | ||
557 | _remote_type=REMOTETYPE_UNPLUGGED; | ||
558 | DEBUGF("Changed remote type to none\n"); | ||
559 | break; | ||
560 | } | ||
561 | break; | ||
562 | case SDLK_KP4: | ||
563 | case SDLK_LEFT: | ||
564 | new_btn = BUTTON_LEFT; | ||
565 | break; | ||
566 | case SDLK_KP6: | ||
567 | case SDLK_RIGHT: | ||
568 | new_btn = BUTTON_RIGHT; | ||
569 | break; | ||
570 | case SDLK_KP8: | ||
571 | case SDLK_UP: | ||
572 | new_btn = BUTTON_UP; | ||
573 | break; | ||
574 | case SDLK_KP2: | ||
575 | case SDLK_DOWN: | ||
576 | new_btn = BUTTON_DOWN; | ||
577 | break; | ||
578 | case SDLK_KP_PLUS: | ||
579 | case SDLK_F8: | ||
580 | new_btn = BUTTON_ON; | ||
581 | break; | ||
582 | case SDLK_KP_ENTER: | ||
583 | case SDLK_RETURN: | ||
584 | case SDLK_a: | ||
585 | new_btn = BUTTON_OFF; | ||
586 | break; | ||
587 | case SDLK_KP_DIVIDE: | ||
588 | case SDLK_F1: | ||
589 | new_btn = BUTTON_REC; | ||
590 | break; | ||
591 | case SDLK_KP5: | ||
592 | case SDLK_SPACE: | ||
593 | new_btn = BUTTON_SELECT; | ||
594 | break; | ||
595 | case SDLK_KP_PERIOD: | ||
596 | case SDLK_INSERT: | ||
597 | new_btn = BUTTON_MODE; | ||
598 | break; | ||
599 | |||
600 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
601 | case SDLK_KP4: | ||
602 | case SDLK_LEFT: | ||
603 | new_btn = BUTTON_LEFT; | ||
604 | break; | ||
605 | case SDLK_KP6: | ||
606 | case SDLK_RIGHT: | ||
607 | new_btn = BUTTON_RIGHT; | ||
608 | break; | ||
609 | case SDLK_KP8: | ||
610 | case SDLK_UP: | ||
611 | new_btn = BUTTON_UP; | ||
612 | break; | ||
613 | case SDLK_KP2: | ||
614 | case SDLK_DOWN: | ||
615 | new_btn = BUTTON_DOWN; | ||
616 | break; | ||
617 | case SDLK_KP_PLUS: | ||
618 | case SDLK_F8: | ||
619 | new_btn = BUTTON_PLAY; | ||
620 | break; | ||
621 | case SDLK_KP_ENTER: | ||
622 | case SDLK_RETURN: | ||
623 | case SDLK_a: | ||
624 | new_btn = BUTTON_EQ; | ||
625 | break; | ||
626 | case SDLK_KP5: | ||
627 | case SDLK_SPACE: | ||
628 | new_btn = BUTTON_SELECT; | ||
629 | break; | ||
630 | case SDLK_KP_PERIOD: | ||
631 | case SDLK_INSERT: | ||
632 | new_btn = BUTTON_MODE; | ||
633 | break; | ||
634 | |||
635 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
636 | case SDLK_KP4: | ||
637 | case SDLK_LEFT: | ||
638 | new_btn = BUTTON_LEFT; | ||
639 | break; | ||
640 | case SDLK_KP6: | ||
641 | case SDLK_RIGHT: | ||
642 | new_btn = BUTTON_RIGHT; | ||
643 | break; | ||
644 | case SDLK_KP8: | ||
645 | case SDLK_UP: | ||
646 | new_btn = BUTTON_UP; | ||
647 | break; | ||
648 | case SDLK_KP2: | ||
649 | case SDLK_DOWN: | ||
650 | new_btn = BUTTON_DOWN; | ||
651 | break; | ||
652 | case SDLK_KP_ENTER: | ||
653 | case SDLK_RETURN: | ||
654 | case SDLK_a: | ||
655 | new_btn = BUTTON_OFF; | ||
656 | break; | ||
657 | case SDLK_KP_PERIOD: | ||
658 | case SDLK_INSERT: | ||
659 | new_btn = BUTTON_MENU; | ||
660 | break; | ||
661 | |||
662 | #elif CONFIG_KEYPAD == PLAYER_PAD | ||
663 | case SDLK_KP4: | ||
664 | case SDLK_LEFT: | ||
665 | new_btn = BUTTON_LEFT; | ||
666 | break; | ||
667 | case SDLK_KP6: | ||
668 | case SDLK_RIGHT: | ||
669 | new_btn = BUTTON_RIGHT; | ||
670 | break; | ||
671 | case SDLK_KP8: | ||
672 | case SDLK_UP: | ||
673 | new_btn = BUTTON_PLAY; | ||
674 | break; | ||
675 | case SDLK_KP2: | ||
676 | case SDLK_DOWN: | ||
677 | new_btn = BUTTON_STOP; | ||
678 | break; | ||
679 | case SDLK_KP_PLUS: | ||
680 | case SDLK_F8: | ||
681 | new_btn = BUTTON_ON; | ||
682 | break; | ||
683 | case SDLK_KP_PERIOD: | ||
684 | case SDLK_INSERT: | ||
685 | new_btn = BUTTON_MENU; | ||
686 | break; | ||
687 | |||
688 | #elif CONFIG_KEYPAD == RECORDER_PAD | ||
689 | case SDLK_KP4: | ||
690 | case SDLK_LEFT: | ||
691 | new_btn = BUTTON_LEFT; | ||
692 | break; | ||
693 | case SDLK_KP6: | ||
694 | case SDLK_RIGHT: | ||
695 | new_btn = BUTTON_RIGHT; | ||
696 | break; | ||
697 | case SDLK_KP8: | ||
698 | case SDLK_UP: | ||
699 | new_btn = BUTTON_UP; | ||
700 | break; | ||
701 | case SDLK_KP2: | ||
702 | case SDLK_DOWN: | ||
703 | new_btn = BUTTON_DOWN; | ||
704 | break; | ||
705 | case SDLK_KP_PLUS: | ||
706 | case SDLK_F8: | ||
707 | new_btn = BUTTON_ON; | ||
708 | break; | ||
709 | case SDLK_KP_ENTER: | ||
710 | case SDLK_RETURN: | ||
711 | case SDLK_a: | ||
712 | new_btn = BUTTON_OFF; | ||
713 | break; | ||
714 | case SDLK_KP_DIVIDE: | ||
715 | case SDLK_F1: | ||
716 | new_btn = BUTTON_F1; | ||
717 | break; | ||
718 | case SDLK_KP_MULTIPLY: | ||
719 | case SDLK_F2: | ||
720 | new_btn = BUTTON_F2; | ||
721 | break; | ||
722 | case SDLK_KP_MINUS: | ||
723 | case SDLK_F3: | ||
724 | new_btn = BUTTON_F3; | ||
725 | break; | ||
726 | case SDLK_KP5: | ||
727 | case SDLK_SPACE: | ||
728 | new_btn = BUTTON_PLAY; | ||
729 | break; | ||
730 | |||
731 | #elif CONFIG_KEYPAD == ARCHOS_AV300_PAD | ||
732 | case SDLK_KP4: | ||
733 | case SDLK_LEFT: | ||
734 | new_btn = BUTTON_LEFT; | ||
735 | break; | ||
736 | case SDLK_KP6: | ||
737 | case SDLK_RIGHT: | ||
738 | new_btn = BUTTON_RIGHT; | ||
739 | break; | ||
740 | case SDLK_KP8: | ||
741 | case SDLK_UP: | ||
742 | new_btn = BUTTON_UP; | ||
743 | break; | ||
744 | case SDLK_KP2: | ||
745 | case SDLK_DOWN: | ||
746 | new_btn = BUTTON_DOWN; | ||
747 | break; | ||
748 | case SDLK_KP_PLUS: | ||
749 | case SDLK_F8: | ||
750 | new_btn = BUTTON_ON; | ||
751 | break; | ||
752 | case SDLK_KP_ENTER: | ||
753 | case SDLK_RETURN: | ||
754 | case SDLK_a: | ||
755 | new_btn = BUTTON_OFF; | ||
756 | break; | ||
757 | case SDLK_KP_DIVIDE: | ||
758 | case SDLK_F1: | ||
759 | new_btn = BUTTON_F1; | ||
760 | break; | ||
761 | case SDLK_KP_MULTIPLY: | ||
762 | case SDLK_F2: | ||
763 | new_btn = BUTTON_F2; | ||
764 | break; | ||
765 | case SDLK_KP_MINUS: | ||
766 | case SDLK_F3: | ||
767 | new_btn = BUTTON_F3; | ||
768 | break; | ||
769 | case SDLK_KP5: | ||
770 | case SDLK_SPACE: | ||
771 | new_btn = BUTTON_SELECT; | ||
772 | break; | ||
773 | 230 | ||
774 | #elif CONFIG_KEYPAD == SANSA_E200_PAD | ||
775 | case SDLK_KP4: | ||
776 | case SDLK_LEFT: | ||
777 | new_btn = BUTTON_LEFT; | ||
778 | break; | ||
779 | case SDLK_KP6: | ||
780 | case SDLK_RIGHT: | ||
781 | new_btn = BUTTON_RIGHT; | ||
782 | break; | ||
783 | case SDLK_KP8: | ||
784 | case SDLK_UP: | ||
785 | new_btn = BUTTON_SCROLL_BACK; | ||
786 | break; | ||
787 | case SDLK_KP2: | ||
788 | case SDLK_DOWN: | ||
789 | new_btn = BUTTON_SCROLL_FWD; | ||
790 | break; | ||
791 | case SDLK_KP9: | ||
792 | case SDLK_PAGEUP: | ||
793 | new_btn = BUTTON_UP; | ||
794 | break; | ||
795 | case SDLK_KP3: | ||
796 | case SDLK_PAGEDOWN: | ||
797 | new_btn = BUTTON_DOWN; | ||
798 | break; | ||
799 | case SDLK_KP1: | ||
800 | case SDLK_HOME: | ||
801 | new_btn = BUTTON_POWER; | ||
802 | break; | ||
803 | case SDLK_KP7: | ||
804 | case SDLK_END: | ||
805 | new_btn = BUTTON_REC; | ||
806 | break; | ||
807 | case SDLK_KP5: | ||
808 | case SDLK_SPACE: | ||
809 | new_btn = BUTTON_SELECT; | ||
810 | break; | ||
811 | |||
812 | #elif CONFIG_KEYPAD == SANSA_C200_PAD | ||
813 | case SDLK_KP4: | ||
814 | case SDLK_LEFT: | ||
815 | new_btn = BUTTON_LEFT; | ||
816 | break; | ||
817 | case SDLK_KP6: | ||
818 | case SDLK_RIGHT: | ||
819 | new_btn = BUTTON_RIGHT; | ||
820 | break; | ||
821 | case SDLK_KP8: | ||
822 | case SDLK_UP: | ||
823 | new_btn = BUTTON_UP; | ||
824 | break; | ||
825 | case SDLK_KP2: | ||
826 | case SDLK_DOWN: | ||
827 | new_btn = BUTTON_DOWN; | ||
828 | break; | ||
829 | case SDLK_KP3: | ||
830 | new_btn = BUTTON_POWER; | ||
831 | break; | ||
832 | case SDLK_KP1: | ||
833 | new_btn = BUTTON_REC; | ||
834 | break; | ||
835 | case SDLK_KP5: | ||
836 | case SDLK_KP_ENTER: | ||
837 | case SDLK_RETURN: | ||
838 | new_btn = BUTTON_SELECT; | ||
839 | break; | ||
840 | case SDLK_KP7: | ||
841 | new_btn = BUTTON_VOL_DOWN; | ||
842 | break; | ||
843 | case SDLK_KP9: | ||
844 | new_btn = BUTTON_VOL_UP; | ||
845 | break; | ||
846 | |||
847 | #elif CONFIG_KEYPAD == MROBE500_PAD | ||
848 | case SDLK_F9: | ||
849 | new_btn = BUTTON_RC_HEART; | ||
850 | break; | ||
851 | case SDLK_F10: | ||
852 | new_btn = BUTTON_RC_MODE; | ||
853 | break; | ||
854 | case SDLK_F11: | ||
855 | new_btn = BUTTON_RC_VOL_DOWN; | ||
856 | break; | ||
857 | case SDLK_F12: | ||
858 | new_btn = BUTTON_RC_VOL_UP; | ||
859 | break; | ||
860 | case SDLK_MINUS: | ||
861 | case SDLK_LESS: | ||
862 | case SDLK_LEFTBRACKET: | ||
863 | case SDLK_KP_DIVIDE: | ||
864 | new_btn = BUTTON_LEFT; | ||
865 | break; | ||
866 | case SDLK_PLUS: | ||
867 | case SDLK_GREATER: | ||
868 | case SDLK_RIGHTBRACKET: | ||
869 | case SDLK_KP_MULTIPLY: | ||
870 | new_btn = BUTTON_RIGHT; | ||
871 | break; | ||
872 | case SDLK_PAGEUP: | ||
873 | new_btn = BUTTON_RC_PLAY; | ||
874 | break; | ||
875 | case SDLK_PAGEDOWN: | ||
876 | new_btn = BUTTON_RC_DOWN; | ||
877 | break; | ||
878 | case SDLK_F8: | ||
879 | case SDLK_ESCAPE: | ||
880 | new_btn = BUTTON_POWER; | ||
881 | break; | ||
882 | #elif CONFIG_KEYPAD == MROBE100_PAD | ||
883 | case SDLK_F9: | ||
884 | new_btn = BUTTON_RC_HEART; | ||
885 | break; | ||
886 | case SDLK_F10: | ||
887 | new_btn = BUTTON_RC_MODE; | ||
888 | break; | ||
889 | case SDLK_F11: | ||
890 | new_btn = BUTTON_RC_VOL_DOWN; | ||
891 | break; | ||
892 | case SDLK_F12: | ||
893 | new_btn = BUTTON_RC_VOL_UP; | ||
894 | break; | ||
895 | case SDLK_LEFT: | ||
896 | new_btn = BUTTON_RC_FF; | ||
897 | break; | ||
898 | case SDLK_RIGHT: | ||
899 | new_btn = BUTTON_RC_REW; | ||
900 | break; | ||
901 | case SDLK_UP: | ||
902 | new_btn = BUTTON_RC_PLAY; | ||
903 | break; | ||
904 | case SDLK_DOWN: | ||
905 | new_btn = BUTTON_RC_DOWN; | ||
906 | break; | ||
907 | case SDLK_KP1: | ||
908 | new_btn = BUTTON_DISPLAY; | ||
909 | break; | ||
910 | case SDLK_KP7: | ||
911 | new_btn = BUTTON_MENU; | ||
912 | break; | ||
913 | case SDLK_KP9: | ||
914 | new_btn = BUTTON_PLAY; | ||
915 | break; | ||
916 | case SDLK_KP4: | ||
917 | new_btn = BUTTON_LEFT; | ||
918 | break; | ||
919 | case SDLK_KP6: | ||
920 | new_btn = BUTTON_RIGHT; | ||
921 | break; | ||
922 | case SDLK_KP8: | ||
923 | new_btn = BUTTON_UP; | ||
924 | break; | ||
925 | case SDLK_KP2: | ||
926 | new_btn = BUTTON_DOWN; | ||
927 | break; | ||
928 | case SDLK_KP5: | ||
929 | case SDLK_SPACE: | ||
930 | new_btn = BUTTON_SELECT; | ||
931 | break; | ||
932 | case SDLK_KP_MULTIPLY: | ||
933 | case SDLK_F8: | ||
934 | case SDLK_ESCAPE: | ||
935 | new_btn = BUTTON_POWER; | ||
936 | break; | ||
937 | |||
938 | #elif CONFIG_KEYPAD == COWON_D2_PAD | ||
939 | case SDLK_KP_MULTIPLY: | ||
940 | case SDLK_F8: | ||
941 | case SDLK_ESCAPE: | ||
942 | case SDLK_BACKSPACE: | ||
943 | case SDLK_DELETE: | ||
944 | new_btn = BUTTON_POWER; | ||
945 | break; | ||
946 | case SDLK_KP_PLUS: | ||
947 | case SDLK_EQUALS: | ||
948 | new_btn = BUTTON_PLUS; | ||
949 | break; | ||
950 | case SDLK_KP_MINUS: | ||
951 | case SDLK_MINUS: | ||
952 | new_btn = BUTTON_MINUS; | ||
953 | break; | ||
954 | case SDLK_KP_ENTER: | ||
955 | case SDLK_RETURN: | ||
956 | case SDLK_SPACE: | ||
957 | case SDLK_INSERT: | ||
958 | new_btn = BUTTON_MENU; | ||
959 | break; | ||
960 | #elif CONFIG_KEYPAD == IAUDIO67_PAD | ||
961 | case SDLK_UP: | ||
962 | new_btn = BUTTON_RIGHT; | ||
963 | break; | ||
964 | case SDLK_DOWN: | ||
965 | new_btn = BUTTON_LEFT; | ||
966 | break; | ||
967 | case SDLK_LEFT: | ||
968 | new_btn = BUTTON_STOP; | ||
969 | break; | ||
970 | case SDLK_RETURN: | ||
971 | case SDLK_KP_ENTER: | ||
972 | case SDLK_RIGHT: | ||
973 | new_btn = BUTTON_PLAY; | ||
974 | break; | ||
975 | case SDLK_PLUS: | ||
976 | new_btn = BUTTON_VOLUP; | ||
977 | break; | ||
978 | case SDLK_MINUS: | ||
979 | new_btn = BUTTON_VOLDOWN; | ||
980 | break; | ||
981 | case SDLK_SPACE: | ||
982 | new_btn = BUTTON_MENU; | ||
983 | break; | ||
984 | case SDLK_BACKSPACE: | ||
985 | new_btn = BUTTON_POWER; | ||
986 | break; | ||
987 | #elif CONFIG_KEYPAD == CREATIVEZVM_PAD | ||
988 | case SDLK_KP1: | ||
989 | new_btn = BUTTON_BACK; | ||
990 | break; | ||
991 | case SDLK_KP3: | ||
992 | new_btn = BUTTON_MENU; | ||
993 | break; | ||
994 | case SDLK_KP7: | ||
995 | new_btn = BUTTON_CUSTOM; | ||
996 | break; | ||
997 | case SDLK_KP9: | ||
998 | new_btn = BUTTON_PLAY; | ||
999 | break; | ||
1000 | case SDLK_KP4: | ||
1001 | case SDLK_LEFT: | ||
1002 | new_btn = BUTTON_LEFT; | ||
1003 | break; | ||
1004 | case SDLK_KP6: | ||
1005 | case SDLK_RIGHT: | ||
1006 | new_btn = BUTTON_RIGHT; | ||
1007 | break; | ||
1008 | case SDLK_KP8: | ||
1009 | case SDLK_UP: | ||
1010 | new_btn = BUTTON_UP; | ||
1011 | break; | ||
1012 | case SDLK_KP2: | ||
1013 | case SDLK_DOWN: | ||
1014 | new_btn = BUTTON_DOWN; | ||
1015 | break; | ||
1016 | case SDLK_KP5: | ||
1017 | case SDLK_SPACE: | ||
1018 | new_btn = BUTTON_SELECT; | ||
1019 | break; | ||
1020 | case SDLK_KP_MULTIPLY: | ||
1021 | case SDLK_F8: | ||
1022 | case SDLK_ESCAPE: | ||
1023 | new_btn = BUTTON_POWER; | ||
1024 | break; | ||
1025 | #elif CONFIG_KEYPAD == CREATIVEZV_PAD | ||
1026 | case SDLK_KP1: | ||
1027 | new_btn = BUTTON_PREV; | ||
1028 | break; | ||
1029 | case SDLK_KP3: | ||
1030 | new_btn = BUTTON_NEXT; | ||
1031 | break; | ||
1032 | case SDLK_KP7: | ||
1033 | new_btn = BUTTON_BACK; | ||
1034 | break; | ||
1035 | case SDLK_p: | ||
1036 | new_btn = BUTTON_PLAY; | ||
1037 | break; | ||
1038 | case SDLK_KP9: | ||
1039 | new_btn = BUTTON_MENU; | ||
1040 | break; | ||
1041 | case SDLK_KP4: | ||
1042 | case SDLK_LEFT: | ||
1043 | new_btn = BUTTON_LEFT; | ||
1044 | break; | ||
1045 | case SDLK_KP6: | ||
1046 | case SDLK_RIGHT: | ||
1047 | new_btn = BUTTON_RIGHT; | ||
1048 | break; | ||
1049 | case SDLK_KP8: | ||
1050 | case SDLK_UP: | ||
1051 | new_btn = BUTTON_UP; | ||
1052 | break; | ||
1053 | case SDLK_KP2: | ||
1054 | case SDLK_DOWN: | ||
1055 | new_btn = BUTTON_DOWN; | ||
1056 | break; | ||
1057 | case SDLK_KP5: | ||
1058 | case SDLK_SPACE: | ||
1059 | new_btn = BUTTON_SELECT; | ||
1060 | break; | ||
1061 | case SDLK_KP_MULTIPLY: | ||
1062 | case SDLK_F8: | ||
1063 | case SDLK_ESCAPE: | ||
1064 | new_btn = BUTTON_POWER; | ||
1065 | break; | ||
1066 | case SDLK_z: | ||
1067 | new_btn = BUTTON_VOL_DOWN; | ||
1068 | break; | ||
1069 | case SDLK_s: | ||
1070 | new_btn = BUTTON_VOL_UP; | ||
1071 | |||
1072 | #elif CONFIG_KEYPAD == MEIZU_M6SL_PAD | ||
1073 | case SDLK_KP1: | ||
1074 | new_btn = BUTTON_PREV; | ||
1075 | break; | ||
1076 | case SDLK_KP3: | ||
1077 | new_btn = BUTTON_NEXT; | ||
1078 | break; | ||
1079 | case SDLK_KP_ENTER: | ||
1080 | case SDLK_RETURN: | ||
1081 | case SDLK_a: | ||
1082 | new_btn = BUTTON_PLAY; | ||
1083 | break; | ||
1084 | case SDLK_KP_PERIOD: | ||
1085 | case SDLK_INSERT: | ||
1086 | new_btn = BUTTON_MENU; | ||
1087 | break; | ||
1088 | case SDLK_KP8: | ||
1089 | case SDLK_UP: | ||
1090 | new_btn = BUTTON_UP; | ||
1091 | break; | ||
1092 | case SDLK_KP2: | ||
1093 | case SDLK_DOWN: | ||
1094 | new_btn = BUTTON_DOWN; | ||
1095 | break; | ||
1096 | case SDLK_KP5: | ||
1097 | case SDLK_SPACE: | ||
1098 | new_btn = BUTTON_SELECT; | ||
1099 | break; | ||
1100 | #elif CONFIG_KEYPAD == SANSA_FUZE_PAD | ||
1101 | case SDLK_KP4: | ||
1102 | case SDLK_LEFT: | ||
1103 | new_btn = BUTTON_LEFT; | ||
1104 | break; | ||
1105 | case SDLK_KP6: | ||
1106 | case SDLK_RIGHT: | ||
1107 | new_btn = BUTTON_RIGHT; | ||
1108 | break; | ||
1109 | case SDLK_KP8: | ||
1110 | case SDLK_UP: | ||
1111 | new_btn = BUTTON_SCROLL_BACK; | ||
1112 | break; | ||
1113 | case SDLK_KP2: | ||
1114 | case SDLK_DOWN: | ||
1115 | new_btn = BUTTON_SCROLL_FWD; | ||
1116 | break; | ||
1117 | case SDLK_PAGEUP: | ||
1118 | case SDLK_KP9: | ||
1119 | new_btn = BUTTON_UP; | ||
1120 | break; | ||
1121 | case SDLK_PAGEDOWN: | ||
1122 | case SDLK_KP3: | ||
1123 | new_btn = BUTTON_DOWN; | ||
1124 | break; | ||
1125 | case SDLK_KP_MINUS: | ||
1126 | case SDLK_KP1: | ||
1127 | new_btn = BUTTON_POWER; | ||
1128 | break; | ||
1129 | case SDLK_KP_MULTIPLY: | ||
1130 | new_btn = BUTTON_HOME; | ||
1131 | break; | ||
1132 | case SDLK_KP5: | ||
1133 | case SDLK_SPACE: | ||
1134 | case SDLK_KP_ENTER: | ||
1135 | case SDLK_RETURN: | ||
1136 | new_btn = BUTTON_SELECT; | ||
1137 | break; | ||
1138 | #elif CONFIG_KEYPAD == SANSA_CLIP_PAD | ||
1139 | case SDLK_KP4: | ||
1140 | case SDLK_LEFT: | ||
1141 | new_btn = BUTTON_LEFT; | ||
1142 | break; | ||
1143 | case SDLK_KP6: | ||
1144 | case SDLK_RIGHT: | ||
1145 | new_btn = BUTTON_RIGHT; | ||
1146 | break; | ||
1147 | case SDLK_KP8: | ||
1148 | case SDLK_UP: | ||
1149 | new_btn = BUTTON_UP; | ||
1150 | break; | ||
1151 | case SDLK_KP2: | ||
1152 | case SDLK_DOWN: | ||
1153 | new_btn = BUTTON_DOWN; | ||
1154 | break; | ||
1155 | |||
1156 | case SDLK_INSERT: | ||
1157 | case SDLK_KP_MULTIPLY: | ||
1158 | new_btn = BUTTON_HOME; | ||
1159 | break; | ||
1160 | case SDLK_SPACE: | ||
1161 | case SDLK_KP5: | ||
1162 | new_btn = BUTTON_SELECT; | ||
1163 | break; | ||
1164 | case SDLK_PAGEDOWN: | ||
1165 | case SDLK_KP3: | ||
1166 | new_btn = BUTTON_VOL_DOWN; | ||
1167 | break; | ||
1168 | case SDLK_PAGEUP: | ||
1169 | case SDLK_KP9: | ||
1170 | new_btn = BUTTON_VOL_UP; | ||
1171 | break; | ||
1172 | case SDLK_ESCAPE: | ||
1173 | case SDLK_KP1: | ||
1174 | new_btn = BUTTON_POWER; | ||
1175 | break; | ||
1176 | #elif CONFIG_KEYPAD == SANSA_M200_PAD | ||
1177 | case SDLK_KP4: | ||
1178 | case SDLK_LEFT: | ||
1179 | new_btn = BUTTON_LEFT; | ||
1180 | break; | ||
1181 | case SDLK_KP6: | ||
1182 | case SDLK_RIGHT: | ||
1183 | new_btn = BUTTON_RIGHT; | ||
1184 | break; | ||
1185 | case SDLK_KP8: | ||
1186 | case SDLK_UP: | ||
1187 | new_btn = BUTTON_UP; | ||
1188 | break; | ||
1189 | case SDLK_KP2: | ||
1190 | case SDLK_DOWN: | ||
1191 | new_btn = BUTTON_DOWN; | ||
1192 | break; | ||
1193 | case SDLK_PLUS: | ||
1194 | new_btn = BUTTON_POWER; | ||
1195 | break; | ||
1196 | case SDLK_KP5: | ||
1197 | new_btn = BUTTON_SELECT; | ||
1198 | break; | ||
1199 | case SDLK_KP7: | ||
1200 | new_btn = BUTTON_VOL_DOWN; | ||
1201 | break; | ||
1202 | case SDLK_KP9: | ||
1203 | new_btn = BUTTON_VOL_UP; | ||
1204 | break; | ||
1205 | #elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD | ||
1206 | case SDLK_KP4: | ||
1207 | case SDLK_LEFT: | ||
1208 | new_btn = BUTTON_LEFT; | ||
1209 | break; | ||
1210 | case SDLK_KP6: | ||
1211 | case SDLK_RIGHT: | ||
1212 | new_btn = BUTTON_RIGHT; | ||
1213 | break; | ||
1214 | case SDLK_KP8: | ||
1215 | case SDLK_UP: | ||
1216 | new_btn = BUTTON_UP; | ||
1217 | break; | ||
1218 | case SDLK_KP2: | ||
1219 | case SDLK_DOWN: | ||
1220 | new_btn = BUTTON_DOWN; | ||
1221 | break; | ||
1222 | case SDLK_KP1: | ||
1223 | new_btn = BUTTON_MENU; | ||
1224 | break; | ||
1225 | case SDLK_KP5: | ||
1226 | case SDLK_SPACE: | ||
1227 | new_btn = BUTTON_PLAY; | ||
1228 | break; | ||
1229 | case SDLK_KP7: | ||
1230 | new_btn = BUTTON_PREV; | ||
1231 | break; | ||
1232 | case SDLK_KP9: | ||
1233 | new_btn = BUTTON_NEXT; | ||
1234 | break; | ||
1235 | case SDLK_KP_ENTER: | ||
1236 | case SDLK_RETURN: | ||
1237 | new_btn = BUTTON_POWER; | ||
1238 | break; | ||
1239 | case SDLK_PAGEUP: | ||
1240 | new_btn = BUTTON_VOL_UP; | ||
1241 | break; | ||
1242 | case SDLK_PAGEDOWN: | ||
1243 | new_btn = BUTTON_VOL_DOWN; | ||
1244 | break; | ||
1245 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD | ||
1246 | case SDLK_KP4: | ||
1247 | case SDLK_LEFT: | ||
1248 | new_btn = BUTTON_LEFT; | ||
1249 | break; | ||
1250 | case SDLK_KP6: | ||
1251 | case SDLK_RIGHT: | ||
1252 | new_btn = BUTTON_RIGHT; | ||
1253 | break; | ||
1254 | case SDLK_KP8: | ||
1255 | case SDLK_UP: | ||
1256 | new_btn = BUTTON_UP; | ||
1257 | break; | ||
1258 | case SDLK_KP2: | ||
1259 | case SDLK_DOWN: | ||
1260 | new_btn = BUTTON_DOWN; | ||
1261 | break; | ||
1262 | case SDLK_KP5: | ||
1263 | case SDLK_SPACE: | ||
1264 | new_btn = BUTTON_SELECT; | ||
1265 | break; | ||
1266 | case SDLK_KP7: | ||
1267 | case SDLK_ESCAPE: | ||
1268 | new_btn = BUTTON_POWER; | ||
1269 | break; | ||
1270 | case SDLK_KP1: | ||
1271 | new_btn = BUTTON_PLAYLIST; | ||
1272 | break; | ||
1273 | case SDLK_KP9: | ||
1274 | new_btn = BUTTON_VOL_UP; | ||
1275 | break; | ||
1276 | case SDLK_KP3: | ||
1277 | new_btn = BUTTON_VOL_DOWN; | ||
1278 | break; | ||
1279 | case SDLK_KP_MINUS: | ||
1280 | new_btn = BUTTON_MENU; | ||
1281 | break; | ||
1282 | case SDLK_KP_PLUS: | ||
1283 | new_btn = BUTTON_VIEW; | ||
1284 | break; | ||
1285 | #elif CONFIG_KEYPAD == ONDAVX747_PAD | ||
1286 | case SDLK_ESCAPE: | ||
1287 | new_btn = BUTTON_POWER; | ||
1288 | break; | ||
1289 | case SDLK_KP_PLUS: | ||
1290 | case SDLK_PLUS: | ||
1291 | case SDLK_GREATER: | ||
1292 | case SDLK_RIGHTBRACKET: | ||
1293 | case SDLK_KP_MULTIPLY: | ||
1294 | new_btn = BUTTON_VOL_UP; | ||
1295 | break; | ||
1296 | case SDLK_KP_MINUS: | ||
1297 | case SDLK_MINUS: | ||
1298 | case SDLK_LESS: | ||
1299 | case SDLK_LEFTBRACKET: | ||
1300 | case SDLK_KP_DIVIDE: | ||
1301 | new_btn = BUTTON_VOL_DOWN; | ||
1302 | break; | ||
1303 | case SDLK_KP_ENTER: | ||
1304 | case SDLK_RETURN: | ||
1305 | new_btn = BUTTON_MENU; | ||
1306 | break; | ||
1307 | #elif CONFIG_KEYPAD == ONDAVX777_PAD | ||
1308 | case SDLK_ESCAPE: | ||
1309 | new_btn = BUTTON_POWER; | ||
1310 | break; | ||
1311 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | ||
1312 | case SDLK_KP4: | ||
1313 | case SDLK_LEFT: | ||
1314 | new_btn = BUTTON_LEFT; | ||
1315 | break; | ||
1316 | case SDLK_KP6: | ||
1317 | case SDLK_RIGHT: | ||
1318 | new_btn = BUTTON_RIGHT; | ||
1319 | break; | ||
1320 | case SDLK_KP8: | ||
1321 | case SDLK_UP: | ||
1322 | new_btn = BUTTON_UP; | ||
1323 | break; | ||
1324 | case SDLK_KP2: | ||
1325 | case SDLK_DOWN: | ||
1326 | new_btn = BUTTON_DOWN; | ||
1327 | break; | ||
1328 | case SDLK_KP5: | ||
1329 | case SDLK_KP_ENTER: | ||
1330 | new_btn = BUTTON_PLAY; | ||
1331 | break; | ||
1332 | case SDLK_KP9: | ||
1333 | case SDLK_PAGEUP: | ||
1334 | new_btn = BUTTON_FFWD; | ||
1335 | break; | ||
1336 | #ifdef SAMSUNG_YH820 | ||
1337 | case SDLK_KP7: | ||
1338 | #else | ||
1339 | case SDLK_KP3: | ||
1340 | #endif | ||
1341 | case SDLK_PAGEDOWN: | ||
1342 | new_btn = BUTTON_REW; | ||
1343 | break; | ||
1344 | case SDLK_KP_PLUS: | ||
1345 | new_btn = BUTTON_REC; | ||
1346 | break; | ||
1347 | #elif CONFIG_KEYPAD == MINI2440_PAD | ||
1348 | /* no keymap, touchscreen */ | ||
1349 | #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD | ||
1350 | case SDLK_KP4: | ||
1351 | case SDLK_LEFT: | ||
1352 | new_btn = BUTTON_PREV; | ||
1353 | break; | ||
1354 | case SDLK_KP6: | ||
1355 | case SDLK_RIGHT: | ||
1356 | new_btn = BUTTON_NEXT; | ||
1357 | break; | ||
1358 | case SDLK_KP8: | ||
1359 | case SDLK_UP: | ||
1360 | new_btn = BUTTON_UP; | ||
1361 | break; | ||
1362 | case SDLK_KP2: | ||
1363 | case SDLK_DOWN: | ||
1364 | new_btn = BUTTON_DOWN; | ||
1365 | break; | ||
1366 | case SDLK_KP7: | ||
1367 | new_btn = BUTTON_MENU; | ||
1368 | break; | ||
1369 | case SDLK_KP9: | ||
1370 | new_btn = BUTTON_PLAY; | ||
1371 | break; | ||
1372 | case SDLK_KP5: | ||
1373 | new_btn = BUTTON_OK; | ||
1374 | break; | ||
1375 | case SDLK_KP_DIVIDE: | ||
1376 | new_btn = BUTTON_CANCEL; | ||
1377 | break; | ||
1378 | case SDLK_KP_PLUS: | ||
1379 | new_btn = BUTTON_POWER; | ||
1380 | break; | ||
1381 | case SDLK_KP_MULTIPLY: | ||
1382 | new_btn = BUTTON_REC; | ||
1383 | break; | ||
1384 | |||
1385 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
1386 | case SDLK_UP: | ||
1387 | new_btn = BUTTON_PREV; | ||
1388 | break; | ||
1389 | case SDLK_DOWN: | ||
1390 | new_btn = BUTTON_NEXT; | ||
1391 | break; | ||
1392 | case SDLK_SPACE: | ||
1393 | new_btn = BUTTON_SELECT; | ||
1394 | break; | ||
1395 | case SDLK_RETURN: | ||
1396 | new_btn = BUTTON_PLAY; | ||
1397 | break; | ||
1398 | case SDLK_LEFT: | ||
1399 | new_btn = BUTTON_VOL_DOWN; | ||
1400 | break; | ||
1401 | case SDLK_RIGHT: | ||
1402 | new_btn = BUTTON_VOL_UP; | ||
1403 | break; | ||
1404 | case SDLK_ESCAPE: | ||
1405 | new_btn = BUTTON_REC; | ||
1406 | break; | ||
1407 | |||
1408 | #else | ||
1409 | #error No keymap defined! | ||
1410 | #endif /* CONFIG_KEYPAD */ | ||
1411 | case SDLK_KP0: | 231 | case SDLK_KP0: |
1412 | case SDLK_F5: | 232 | case SDLK_F5: |
1413 | if(pressed) | 233 | if(pressed) |
@@ -1416,8 +236,14 @@ static void button_event(int key, bool pressed) | |||
1416 | return; | 236 | return; |
1417 | } | 237 | } |
1418 | break; | 238 | break; |
239 | default: | ||
240 | #ifdef HAVE_TOUCHSCREEN | ||
241 | new_btn = key_to_touch(key); | ||
242 | if (!new_btn) | ||
243 | #endif | ||
244 | new_btn = key_to_button(key); | ||
245 | break; | ||
1419 | } | 246 | } |
1420 | |||
1421 | /* Call to make up for scrollwheel target implementation. This is | 247 | /* Call to make up for scrollwheel target implementation. This is |
1422 | * not handled in the main button.c driver, but on the target | 248 | * not handled in the main button.c driver, but on the target |
1423 | * implementation (look at button-e200.c for example if you are trying to | 249 | * implementation (look at button-e200.c for example if you are trying to |
@@ -1513,477 +339,3 @@ void button_init_device(void) | |||
1513 | tick_add_task(mouse_tick_task); | 339 | tick_add_task(mouse_tick_task); |
1514 | #endif | 340 | #endif |
1515 | } | 341 | } |
1516 | |||
1517 | /* Button maps: simulated key, x, y, radius, name */ | ||
1518 | /* Run sim with --mapping to get coordinates */ | ||
1519 | /* or --debugbuttons to check */ | ||
1520 | /* The First matching button is returned */ | ||
1521 | struct button_map { | ||
1522 | int button, x, y, radius; | ||
1523 | char *description; | ||
1524 | }; | ||
1525 | |||
1526 | #ifdef SANSA_FUZE | ||
1527 | struct button_map bm[] = { | ||
1528 | { SDLK_KP8, 70, 265, 35, "Scroll Back" }, | ||
1529 | { SDLK_KP9, 141, 255, 31, "Play" }, | ||
1530 | { SDLK_KP_MULTIPLY, 228, 267, 18, "Home" }, | ||
1531 | { SDLK_LEFT, 69, 329, 31, "Left" }, | ||
1532 | { SDLK_SPACE, 141, 330, 20, "Select" }, | ||
1533 | { SDLK_RIGHT, 214, 331, 23, "Right" }, | ||
1534 | { SDLK_KP3, 142, 406, 30, "Menu" }, | ||
1535 | { SDLK_DOWN, 221, 384, 24, "Scroll Fwd" }, | ||
1536 | { SDLK_KP_MINUS, 270, 299, 25, "Power" }, | ||
1537 | { SDLK_h, 269, 358, 26, "Hold" }, | ||
1538 | { 0, 0, 0, 0, "None" } | ||
1539 | }; | ||
1540 | #elif defined (SANSA_CLIP) | ||
1541 | struct button_map bm[] = { | ||
1542 | { SDLK_KP_MULTIPLY, 165, 158, 17, "Home" }, | ||
1543 | { SDLK_KP5, 102, 230, 29, "Select" }, | ||
1544 | { SDLK_KP8, 100, 179, 25, "Play" }, | ||
1545 | { SDLK_KP4, 53, 231, 21, "Left" }, | ||
1546 | { SDLK_KP6, 147, 232, 19, "Right" }, | ||
1547 | { SDLK_KP2, 105, 275, 22, "Menu" }, | ||
1548 | { 0, 0, 0, 0, "None" } | ||
1549 | }; | ||
1550 | #elif defined (SANSA_C200) || defined(SANSA_C200V2) | ||
1551 | struct button_map bm[] = { | ||
1552 | |||
1553 | { SDLK_KP7, 84, 7, 21, "Vol Down" }, | ||
1554 | { SDLK_KP9, 158, 7, 20, "Vol Up" }, | ||
1555 | { SDLK_KP1, 173, 130, 27, "Record" }, | ||
1556 | { SDLK_KP5, 277, 75, 21, "Select" }, | ||
1557 | { SDLK_KP4, 233, 75, 24, "Left" }, | ||
1558 | { SDLK_KP6, 313, 74, 18, "Right" }, | ||
1559 | { SDLK_KP8, 276, 34, 15, "Play" }, | ||
1560 | { SDLK_KP2, 277, 119, 17, "Down" }, | ||
1561 | { SDLK_KP3, 314, 113, 19, "Menu" }, | ||
1562 | { 0, 0, 0, 0, "None" } | ||
1563 | }; | ||
1564 | #elif defined (SANSA_E200V2) || defined(SANSA_E200) | ||
1565 | struct button_map bm[] = { | ||
1566 | { SDLK_KP7, 5, 92, 18, "Record" }, | ||
1567 | { SDLK_KP9, 128, 295, 43, "Play" }, | ||
1568 | { SDLK_KP4, 42, 380, 33, "Left" }, | ||
1569 | { SDLK_KP5, 129, 378, 36, "Select" }, | ||
1570 | { SDLK_KP6, 218, 383, 30, "Right" }, | ||
1571 | { SDLK_KP3, 129, 461, 29, "Down" }, | ||
1572 | { SDLK_KP1, 55, 464, 20, "Menu" }, | ||
1573 | { SDLK_KP8, 92, 338, 17, "Scroll Back" }, | ||
1574 | { SDLK_KP2, 167, 342, 17, "Scroll Fwd" }, | ||
1575 | { 0, 0, 0, 0, "None" } | ||
1576 | }; | ||
1577 | #elif defined (SANSA_M200V4) | ||
1578 | struct button_map bm[] = { | ||
1579 | { SDLK_KP_PLUS, 54, 14, 16, "Power" }, | ||
1580 | { SDLK_KP7, 96, 13, 12, "Vol Down" }, | ||
1581 | { SDLK_KP9, 139, 14, 14, "Vol Up" }, | ||
1582 | { SDLK_KP5, 260, 82, 20, "Select" }, | ||
1583 | { SDLK_KP8, 258, 35, 30, "Play" }, | ||
1584 | { SDLK_KP4, 214, 84, 25, "Left" }, | ||
1585 | { SDLK_KP6, 300, 83, 24, "Right" }, | ||
1586 | { SDLK_KP2, 262, 125, 28, "Repeat" }, | ||
1587 | { SDLK_h, 113, 151, 21, "Hold" }, | ||
1588 | { 0, 0, 0, 0, "None" } | ||
1589 | }; | ||
1590 | #elif defined (IPOD_VIDEO) | ||
1591 | struct button_map bm[] = { | ||
1592 | { SDLK_KP_PERIOD, 174, 350, 35, "Menu" }, | ||
1593 | { SDLK_KP8, 110, 380, 33, "Scroll Back" }, | ||
1594 | { SDLK_KP2, 234, 377, 34, "Scroll Fwd" }, | ||
1595 | { SDLK_KP4, 78, 438, 47, "Left" }, | ||
1596 | { SDLK_KP5, 172, 435, 43, "Select" }, | ||
1597 | { SDLK_KP6, 262, 438, 52, "Right" }, | ||
1598 | { SDLK_KP_PLUS, 172, 519, 43, "Play" }, | ||
1599 | { 0, 0, 0 , 0, "None" } | ||
1600 | }; | ||
1601 | #elif defined (IPOD_MINI) || defined(IPOD_MINI2G) | ||
1602 | struct button_map bm[] = { | ||
1603 | { SDLK_KP5, 92, 267, 29, "Select" }, | ||
1604 | { SDLK_KP4, 31, 263, 37, "Left" }, | ||
1605 | { SDLK_KP6, 150, 268, 33, "Right" }, | ||
1606 | { SDLK_KP_PERIOD, 93, 209, 30, "Menu" }, | ||
1607 | { SDLK_KP_PLUS, 93, 324, 25, "Play" }, | ||
1608 | { SDLK_KP8, 53, 220, 29, "Scroll Back" }, | ||
1609 | { SDLK_KP2, 134, 219, 31, "Scroll Fwd" }, | ||
1610 | { 0, 0, 0 , 0, "None" } | ||
1611 | }; | ||
1612 | #elif defined (IPOD_3G) | ||
1613 | struct button_map bm[] = { | ||
1614 | { SDLK_KP5, 108, 296, 26, "Select" }, | ||
1615 | { SDLK_KP8, 70, 255, 26, "Scroll Back" }, | ||
1616 | { SDLK_KP2, 149, 256, 28, "Scroll Fwd" }, | ||
1617 | { SDLK_KP4, 27, 186, 22, "Left" }, | ||
1618 | { SDLK_KP_PERIOD, 82, 185, 22, "Menu" }, | ||
1619 | { SDLK_KP_PERIOD, 133, 185, 21, "Play" }, | ||
1620 | { SDLK_KP6, 189, 188, 21, "Right" }, | ||
1621 | { 0, 0, 0 , 0, "None" } | ||
1622 | }; | ||
1623 | #elif defined (IPOD_4G) | ||
1624 | struct button_map bm[] = { | ||
1625 | { SDLK_KP5, 96, 269, 27, "Select" }, | ||
1626 | { SDLK_KP4, 39, 267, 30, "Left" }, | ||
1627 | { SDLK_KP6, 153, 270, 27, "Right" }, | ||
1628 | { SDLK_KP_PERIOD, 96, 219, 30, "Menu" }, | ||
1629 | { SDLK_KP_PLUS, 95, 326, 27, "Play" }, | ||
1630 | { SDLK_KP8, 57, 233, 29, "Scroll Back" }, | ||
1631 | { SDLK_KP2, 132, 226, 29, "Scroll Fwd" }, | ||
1632 | { 0, 0, 0 , 0, "None" } | ||
1633 | }; | ||
1634 | #elif defined (IPOD_COLOR) | ||
1635 | struct button_map bm[] = { | ||
1636 | { SDLK_KP5, 128, 362, 35, "Select" }, | ||
1637 | { SDLK_KP4, 55, 358, 38, "Left" }, | ||
1638 | { SDLK_KP6, 203, 359, 39, "Right" }, | ||
1639 | { SDLK_KP_PERIOD, 128, 282, 34, "Menu" }, | ||
1640 | { SDLK_KP_PLUS, 129, 439, 41, "Play" }, | ||
1641 | { SDLK_KP8, 76, 309, 34, "Scroll Back" }, | ||
1642 | { SDLK_KP2, 182, 311, 45, "Scroll Fwd" }, | ||
1643 | { 0, 0, 0 , 0, "None" } | ||
1644 | }; | ||
1645 | #elif defined (IPOD_1G2G) | ||
1646 | struct button_map bm[] = { | ||
1647 | { SDLK_KP5, 112, 265, 31, "Select" }, | ||
1648 | { SDLK_KP8, 74, 224, 28, "Scroll Back" }, | ||
1649 | { SDLK_KP2, 146, 228, 28, "Scroll Fwd" }, | ||
1650 | /* Dummy button to make crescent shape */ | ||
1651 | { SDLK_y, 112, 265, 76, "None" }, | ||
1652 | { SDLK_KP8, 74, 224, 28, "Scroll Back" }, | ||
1653 | { SDLK_KP2, 146, 228, 28, "Scroll Fwd" }, | ||
1654 | { SDLK_KP6, 159, 268, 64, "Right" }, | ||
1655 | { SDLK_KP4, 62, 266, 62, "Left" }, | ||
1656 | { SDLK_KP_PERIOD, 111, 216, 64, "Menu" }, | ||
1657 | { SDLK_KP_PLUS, 111, 326, 55, "Down" }, | ||
1658 | { 0, 0, 0 , 0, "None" } | ||
1659 | }; | ||
1660 | #elif defined (IPOD_NANO) | ||
1661 | struct button_map bm[] = { | ||
1662 | { SDLK_KP5, 98, 316, 37, "Select" }, | ||
1663 | { SDLK_KP4, 37, 312, 28, "Left" }, | ||
1664 | { SDLK_KP6, 160, 313, 25, "Right" }, | ||
1665 | { SDLK_KP_PERIOD,102, 256, 23, "Menu" }, | ||
1666 | { SDLK_KP_PLUS, 99, 378, 28, "Play" }, | ||
1667 | { SDLK_KP8, 58, 272, 24, "Scroll Back" }, | ||
1668 | { SDLK_KP2, 141, 274, 22, "Scroll Fwd" }, | ||
1669 | { 0, 0, 0 , 0, "None" } | ||
1670 | }; | ||
1671 | #elif defined (IPOD_NANO2G) | ||
1672 | struct button_map bm[] = { | ||
1673 | { SDLK_KP5, 118, 346, 37, "Select" }, | ||
1674 | { SDLK_KP4, 51, 345, 28, "Left" }, | ||
1675 | { SDLK_KP6, 180, 346, 26, "Right" }, | ||
1676 | { SDLK_KP_PERIOD, 114, 286, 23, "Menu" }, | ||
1677 | { SDLK_KP_PLUS, 115, 412, 27, "Down" }, | ||
1678 | { SDLK_KP8, 67, 303, 28, "Scroll Back" }, | ||
1679 | { SDLK_KP2, 163, 303, 27, "Scroll Fwd" }, | ||
1680 | { 0, 0, 0 , 0, "None" } | ||
1681 | }; | ||
1682 | #elif defined (COWON_D2) | ||
1683 | struct button_map bm[] = { | ||
1684 | { SDLK_DELETE, 51, 14, 17, "Power" }, | ||
1685 | { SDLK_h, 138, 14, 16, "Hold" }, | ||
1686 | { SDLK_MINUS, 320, 14, 10, "Minus" }, | ||
1687 | { SDLK_INSERT, 347, 13, 13, "Menu" }, | ||
1688 | { SDLK_KP_PLUS, 374, 14, 12, "Plus" }, | ||
1689 | { 0, 0, 0, 0, "None" } | ||
1690 | }; | ||
1691 | #elif defined (IAUDIO_M3) | ||
1692 | struct button_map bm[] = { | ||
1693 | { SDLK_KP5, 256, 72, 29, "Play" }, | ||
1694 | { SDLK_KP6, 255, 137, 28, "Right" }, | ||
1695 | { SDLK_KP4, 257, 201, 26, "Left" }, | ||
1696 | { SDLK_KP8, 338, 31, 27, "Up" }, | ||
1697 | { SDLK_KP2, 339, 92, 23, "Down" }, | ||
1698 | { SDLK_KP_PERIOD, 336, 50, 23, "Mode" }, | ||
1699 | { SDLK_KP_DIVIDE, 336, 147, 23, "Rec" }, | ||
1700 | { SDLK_h, 336, 212, 30, "Hold" }, | ||
1701 | /* remote */ | ||
1702 | { SDLK_SPACE, 115, 308, 20, "RC Play" }, | ||
1703 | { SDLK_RIGHT, 85, 308, 20, "RC Rew" }, | ||
1704 | { SDLK_LEFT, 143, 308, 20, "RC FF" }, | ||
1705 | { SDLK_UP, 143, 498, 20, "RC Up" }, | ||
1706 | { SDLK_DOWN, 85, 498, 20, "RC Down" }, | ||
1707 | { SDLK_INSERT, 212, 308, 30, "RC Mode" }, | ||
1708 | { SDLK_F1, 275, 308, 25, "RC Rec" }, | ||
1709 | { SDLK_KP_ENTER, 115, 498, 20, "RC Menu" }, | ||
1710 | { 0, 0, 0, 0, "None" } | ||
1711 | }; | ||
1712 | #elif defined (IAUDIO_M5) | ||
1713 | struct button_map bm[] = { | ||
1714 | { SDLK_KP_ENTER, 333, 41, 17, "Enter" }, | ||
1715 | { SDLK_h, 334, 74, 21, "Hold" }, | ||
1716 | { SDLK_KP_DIVIDE, 333, 142, 24, "Record" }, | ||
1717 | { SDLK_KP_PLUS, 332, 213, 20, "Play" }, | ||
1718 | { SDLK_KP5, 250, 291, 19, "Select" }, | ||
1719 | { SDLK_KP8, 249, 236, 32, "Up" }, | ||
1720 | { SDLK_KP4, 194, 292, 29, "Left" }, | ||
1721 | { SDLK_KP6, 297, 290, 27, "Right" }, | ||
1722 | { SDLK_KP2, 252, 335, 28, "Down" }, | ||
1723 | { 0, 0, 0, 0, "None" } | ||
1724 | }; | ||
1725 | #elif defined (IAUDIO_7) | ||
1726 | struct button_map bm[] = { | ||
1727 | { 0, 0, 0, 0, "None" } | ||
1728 | }; | ||
1729 | #elif defined (IAUDIO_X5) | ||
1730 | struct button_map bm[] = { | ||
1731 | { SDLK_KP_ENTER, 275, 38, 17, "Power" }, | ||
1732 | { SDLK_h, 274, 83, 16, "Hold" }, | ||
1733 | { SDLK_KP_DIVIDE, 276, 128, 22, "Record" }, | ||
1734 | { SDLK_KP_PLUS, 274, 186, 22, "Play" }, | ||
1735 | { SDLK_KP5, 200, 247, 16, "Select" }, | ||
1736 | { SDLK_KP8, 200, 206, 16, "Up" }, | ||
1737 | { SDLK_KP4, 163, 248, 19, "Left" }, | ||
1738 | { SDLK_KP6, 225, 247, 24, "Right" }, | ||
1739 | { SDLK_KP2, 199, 279, 20, "Down" }, | ||
1740 | { 0, 0, 0, 0, "None" } | ||
1741 | }; | ||
1742 | #elif defined (ARCHOS_PLAYER) | ||
1743 | struct button_map bm[] = { | ||
1744 | { SDLK_KP_PLUS, 79, 252, 23, "On" }, | ||
1745 | { SDLK_KP_PERIOD, 81, 310, 20, "Menu" }, | ||
1746 | { SDLK_KP8, 154, 237, 28, "Play" }, | ||
1747 | { SDLK_KP4, 121, 282, 23, "Left" }, | ||
1748 | { SDLK_KP6, 187, 282, 22, "Right" }, | ||
1749 | { SDLK_KP2, 157, 312, 20, "Down" }, | ||
1750 | { 0, 0, 0, 0, "None" } | ||
1751 | }; | ||
1752 | #elif defined (ARCHOS_RECORDER) | ||
1753 | struct button_map bm[] = { | ||
1754 | { SDLK_F1, 94, 205, 22, "F1" }, | ||
1755 | { SDLK_F2, 136, 204, 21, "F2" }, | ||
1756 | { SDLK_F3, 174, 204, 24, "F3" }, | ||
1757 | { SDLK_KP_PLUS, 75, 258, 19, "On" }, | ||
1758 | { SDLK_KP_ENTER, 76, 307, 15, "Off" }, | ||
1759 | { SDLK_KP5, 151, 290, 20, "Select" }, | ||
1760 | { SDLK_KP8, 152, 251, 23, "Up" }, | ||
1761 | { SDLK_KP4, 113, 288, 26, "Left" }, | ||
1762 | { SDLK_KP6, 189, 291, 23, "Right" }, | ||
1763 | { SDLK_KP2, 150, 327, 27, "Down" }, | ||
1764 | { 0, 0, 0, 0, "None" } | ||
1765 | }; | ||
1766 | #elif defined (ARCHOS_FMRECORDER) || defined (ARCHOS_RECORDERV2) | ||
1767 | struct button_map bm[] = { | ||
1768 | { SDLK_F1, 88, 210, 28, "F1" }, | ||
1769 | { SDLK_F2, 144, 212, 28, "F2" }, | ||
1770 | { SDLK_F3, 197, 212, 28, "F3" }, | ||
1771 | { SDLK_KP5, 144, 287, 21, "Select" }, | ||
1772 | { SDLK_KP_PLUS, 86, 320, 13, "Menu" }, | ||
1773 | { SDLK_KP_ENTER, 114, 347, 13, "Stop" }, | ||
1774 | { SDLK_y, 144, 288, 31, "None" }, | ||
1775 | { SDLK_KP8, 144, 259, 25, "Up" }, | ||
1776 | { SDLK_KP2, 144, 316, 31, "Down" }, | ||
1777 | { SDLK_KP6, 171, 287, 32, "Right" }, | ||
1778 | { SDLK_KP4, 117, 287, 31, "Left" }, | ||
1779 | { 0, 0, 0, 0, "None" } | ||
1780 | }; | ||
1781 | #elif defined (ARCHOS_ONDIOSP) || defined (ARCHOS_ONDIOFM) | ||
1782 | struct button_map bm[] = { | ||
1783 | { SDLK_KP_ENTER, 75, 23, 30, "Enter" }, | ||
1784 | { SDLK_KP8, 75, 174, 33, "KP8" }, | ||
1785 | { SDLK_KP4, 26, 186, 48, "KP4" }, | ||
1786 | { SDLK_KP6, 118, 196, 32, "KP6" }, | ||
1787 | { SDLK_KP2, 75, 234, 16, "KP2" }, | ||
1788 | { SDLK_KP_PERIOD, 54, 250, 24, "Period" }, | ||
1789 | { 0, 0, 0, 0, "None" } | ||
1790 | }; | ||
1791 | #elif defined (IRIVER_H10) | ||
1792 | struct button_map bm[] = { | ||
1793 | { SDLK_KP_PLUS, 38, 70, 37, "Power" }, | ||
1794 | { SDLK_KP4, 123, 194, 26, "Cancel" }, | ||
1795 | { SDLK_KP6, 257, 195, 34, "Select" }, | ||
1796 | { SDLK_KP8, 190, 221, 28, "Up" }, | ||
1797 | { SDLK_KP2, 192, 320, 27, "Down" }, | ||
1798 | { SDLK_KP_DIVIDE, 349, 49, 20, "Rew" }, | ||
1799 | { SDLK_KP5, 349, 96, 20, "Play" }, | ||
1800 | { SDLK_KP_MULTIPLY, 350, 141, 23, "FF" }, | ||
1801 | { 0, 0, 0, 0, "None" } | ||
1802 | }; | ||
1803 | #elif defined (IRIVER_H10_5GB) | ||
1804 | struct button_map bm[] = { | ||
1805 | { SDLK_KP_PLUS, 34, 76, 23, "Power" }, | ||
1806 | { SDLK_KP4, 106, 222, 28, "Cancel" }, | ||
1807 | { SDLK_KP6, 243, 220, 31, "Select" }, | ||
1808 | { SDLK_KP8, 176, 254, 34, "Up" }, | ||
1809 | { SDLK_KP2, 175, 371, 35, "Down" }, | ||
1810 | { SDLK_KP_DIVIDE, 319, 63, 26, "Rew" }, | ||
1811 | { SDLK_KP5, 320, 124, 26, "Play" }, | ||
1812 | { SDLK_KP_MULTIPLY, 320, 181, 32, "FF" }, | ||
1813 | { 0, 0, 0, 0, "None" } | ||
1814 | }; | ||
1815 | #elif defined (IRIVER_H120) || defined (IRIVER_H100) | ||
1816 | struct button_map bm[] = { | ||
1817 | { SDLK_KP_DIVIDE, 46, 162, 13, "Record" }, | ||
1818 | { SDLK_KP_PLUS, 327, 36, 16, "Play" }, | ||
1819 | { SDLK_KP_ENTER, 330, 99, 18, "Stop" }, | ||
1820 | { SDLK_KP_PERIOD, 330, 163, 18, "AB" }, | ||
1821 | { SDLK_KP5, 186, 227, 27, "5" }, | ||
1822 | { SDLK_KP8, 187, 185, 19, "8" }, | ||
1823 | { SDLK_KP4, 142, 229, 23, "4" }, | ||
1824 | { SDLK_KP6, 231, 229, 22, "6" }, | ||
1825 | { SDLK_KP2, 189, 272, 28, "2" }, | ||
1826 | /* Remote Buttons */ | ||
1827 | { SDLK_KP_ENTER, 250, 404, 20, "Stop" }, | ||
1828 | { SDLK_SPACE, 285, 439, 29, "Space" }, | ||
1829 | { SDLK_h, 336, 291, 24, "Hold" }, | ||
1830 | { 0, 0, 0, 0, "None" } | ||
1831 | }; | ||
1832 | #elif defined (IRIVER_H300) | ||
1833 | struct button_map bm[] = { | ||
1834 | { SDLK_KP_PLUS, 56, 335, 20, "Play" }, | ||
1835 | { SDLK_KP8, 140, 304, 29, "Up" }, | ||
1836 | { SDLK_KP_DIVIDE, 233, 331, 23, "Record" }, | ||
1837 | { SDLK_KP_ENTER, 54, 381, 24, "Stop" }, | ||
1838 | { SDLK_KP4, 100, 353, 17, "Left" }, | ||
1839 | { SDLK_KP5, 140, 351, 19, "Navi" }, | ||
1840 | { SDLK_KP6, 185, 356, 19, "Right" }, | ||
1841 | { SDLK_KP_PERIOD, 230, 380, 20, "AB" }, | ||
1842 | { SDLK_KP2, 142, 402, 24, "Down" }, | ||
1843 | { SDLK_KP_ENTER, 211, 479, 21, "Stop" }, | ||
1844 | { SDLK_KP_PLUS, 248, 513, 29, "Play" }, | ||
1845 | { 0, 0, 0, 0, "None" } | ||
1846 | }; | ||
1847 | #elif defined (MROBE_500) | ||
1848 | struct button_map bm[] = { | ||
1849 | { SDLK_KP9, 171, 609, 9, "Play" }, | ||
1850 | { SDLK_KP4, 158, 623, 9, "Left" }, | ||
1851 | { SDLK_KP6, 184, 622, 9, "Right" }, | ||
1852 | { SDLK_KP7, 171, 638, 11, "Menu" }, | ||
1853 | { 0, 0, 0, 0, "None" } | ||
1854 | }; | ||
1855 | #elif defined (MROBE_100) | ||
1856 | struct button_map bm[] = { | ||
1857 | { SDLK_KP7, 80, 233, 30, "Menu" }, | ||
1858 | { SDLK_KP8, 138, 250, 19, "Up" }, | ||
1859 | { SDLK_KP9, 201, 230, 27, "Play" }, | ||
1860 | { SDLK_KP4, 63, 305, 25, "Left" }, | ||
1861 | { SDLK_KP5, 125, 309, 28, "Select" }, | ||
1862 | { SDLK_KP6, 200, 307, 35, "Right" }, | ||
1863 | { SDLK_KP1, 52, 380, 32, "Display" }, | ||
1864 | { SDLK_KP2, 125, 363, 30, "Down" }, | ||
1865 | { SDLK_KP9, 168, 425, 10, "Play" }, | ||
1866 | { SDLK_KP4, 156, 440, 11, "Left" }, | ||
1867 | { SDLK_KP6, 180, 440, 13, "Right" }, | ||
1868 | { SDLK_KP7, 169, 452, 10, "Menu" }, | ||
1869 | { SDLK_KP_MULTIPLY, 222, 15, 16, "Power" }, | ||
1870 | { 0, 0, 0, 0, "None" } | ||
1871 | }; | ||
1872 | #elif defined (GIGABEAT_F) | ||
1873 | struct button_map bm[] = { | ||
1874 | { SDLK_KP_PLUS, 361, 187, 22, "Power" }, | ||
1875 | { SDLK_KP_PERIOD, 361, 270, 17, "Menu" }, | ||
1876 | { SDLK_KP9, 365, 345, 26, "Vol Up" }, | ||
1877 | { SDLK_KP3, 363, 433, 25, "Vol Down" }, | ||
1878 | { SDLK_KP_ENTER, 365, 520, 19, "A" }, | ||
1879 | { SDLK_KP8, 167, 458, 35, "Up" }, | ||
1880 | { SDLK_KP4, 86, 537, 29, "Left" }, | ||
1881 | { SDLK_KP5, 166, 536, 30, "Select" }, | ||
1882 | { SDLK_KP6, 248, 536, 30, "Right" }, | ||
1883 | { SDLK_KP2, 169, 617, 28, "Down" }, | ||
1884 | { 0, 0, 0, 0, "None" } | ||
1885 | }; | ||
1886 | #elif defined (GIGABEAT_S) | ||
1887 | struct button_map bm[] = { | ||
1888 | { SDLK_KP_PLUS, 416, 383, 23, "Play" }, | ||
1889 | { SDLK_KP7, 135, 442, 46, "Back" }, | ||
1890 | { SDLK_KP9, 288, 447, 35, "Menu" }, | ||
1891 | { SDLK_KP8, 214, 480, 32, "Up" }, | ||
1892 | { SDLK_KP4, 128, 558, 33, "Left" }, | ||
1893 | { SDLK_KP5, 214, 556, 34, "Select" }, | ||
1894 | { SDLK_KP6, 293, 558, 35, "Right" }, | ||
1895 | { SDLK_KP2, 214, 637, 38, "Down" }, | ||
1896 | { 0, 0, 0, 0, "None" } | ||
1897 | }; | ||
1898 | #elif defined (SAMSUNG_YH820) | ||
1899 | struct button_map bm[] = { | ||
1900 | { SDLK_KP_PLUS, 330, 53, 23, "Record" }, | ||
1901 | { SDLK_KP7, 132, 208, 21, "Left" }, | ||
1902 | { SDLK_KP5, 182, 210, 18, "Play" }, | ||
1903 | { SDLK_KP9, 234, 211, 22, "Right" }, | ||
1904 | { SDLK_KP8, 182, 260, 15, "Up" }, | ||
1905 | { SDLK_KP4, 122, 277, 29, "Menu" }, | ||
1906 | { SDLK_KP6, 238, 276, 25, "Select" }, | ||
1907 | { SDLK_KP2, 183, 321, 24, "Down" }, | ||
1908 | { 0, 0, 0, 0, "None" } | ||
1909 | }; | ||
1910 | #elif defined (SAMSUNG_YH920) || defined (SAMSUNG_YH925) | ||
1911 | struct button_map bm[] = { | ||
1912 | { SDLK_KP9, 370, 32, 15, "FF" }, | ||
1913 | { SDLK_KP5, 369, 84, 25, "Play" }, | ||
1914 | { SDLK_KP5, 367, 125, 27, "Play" }, | ||
1915 | { SDLK_KP3, 369, 188, 17, "Rew" }, | ||
1916 | { SDLK_KP_PLUS, 370, 330, 30, "Record" }, | ||
1917 | { SDLK_KP4, 146, 252, 32, "Menu" }, | ||
1918 | { SDLK_KP8, 204, 226, 27, "Up" }, | ||
1919 | { SDLK_KP6, 257, 250, 34, "Select" }, | ||
1920 | { SDLK_KP2, 205, 294, 35, "Down" }, | ||
1921 | { 0, 0, 0, 0, "None" } | ||
1922 | }; | ||
1923 | #elif defined (ONDA_VX747) || defined (ONDA_VX747P) | ||
1924 | struct button_map bm[] = { | ||
1925 | { SDLK_MINUS, 113, 583, 28, "Minus" }, | ||
1926 | { SDLK_PLUS, 227, 580, 28, "Plus" }, | ||
1927 | { SDLK_RETURN, 171, 583, 34, "Menu" }, | ||
1928 | { 0, 0, 0, 0, "None" } | ||
1929 | }; | ||
1930 | #elif defined (PHILIPS_SA9200) | ||
1931 | struct button_map bm[] = { | ||
1932 | { SDLK_KP_ENTER, 25, 155, 33, "Power" }, | ||
1933 | { SDLK_PAGEUP, 210, 98, 31, "Vol Up" }, | ||
1934 | { SDLK_PAGEDOWN, 210, 168, 34, "Vol Down" }, | ||
1935 | { SDLK_KP7, 40, 249, 26, "Prev" }, | ||
1936 | { SDLK_KP8, 110, 247, 22, "Up" }, | ||
1937 | { SDLK_KP9, 183, 249, 31, "Next" }, | ||
1938 | { SDLK_KP4, 45, 305, 25, "Left" }, | ||
1939 | { SDLK_KP5, 111, 304, 24, "Play" }, | ||
1940 | { SDLK_KP6, 183, 304, 21, "Right" }, | ||
1941 | { SDLK_KP1, 43, 377, 21, "Menu" }, | ||
1942 | { SDLK_KP2, 112, 371, 24, "Down" }, | ||
1943 | { 0, 0, 0, 0, "None" } | ||
1944 | }; | ||
1945 | #elif defined (CREATIVE_ZVM) || defined (CREATIVE_ZVM60GB) || \ | ||
1946 | defined (CREATIVE_ZV) | ||
1947 | struct button_map bm[] = { | ||
1948 | { SDLK_KP7, 52, 414, 35, "Custom" }, | ||
1949 | { SDLK_KP8, 185, 406, 55, "Up" }, | ||
1950 | { SDLK_KP9, 315, 421, 46, "Play" }, | ||
1951 | { SDLK_KP4, 122, 500, 41, "Left" }, | ||
1952 | { SDLK_KP6, 247, 493, 49, "Right" }, | ||
1953 | { SDLK_KP1, 58, 577, 49, "Back" }, | ||
1954 | { SDLK_KP2, 186, 585, 46, "Down" }, | ||
1955 | { SDLK_KP3, 311, 569, 47, "Menu" }, | ||
1956 | { 0, 0, 0, 0, "None" } | ||
1957 | }; | ||
1958 | #elif defined (MPIO_HD200) | ||
1959 | struct button_map bm[] = { | ||
1960 | { SDLK_ESCAPE, 369, 257, 20, "Rec" }, | ||
1961 | { SDLK_RETURN, 369, 305, 20, "Play/Stop" }, | ||
1962 | { SDLK_UP, 353, 168, 10, "Rew" }, | ||
1963 | { SDLK_DOWN, 353, 198, 10, "FF" }, | ||
1964 | { SDLK_SPACE, 353, 186, 10, "Select" }, | ||
1965 | { SDLK_LEFT, 123, 67, 20, "Vol Down" }, | ||
1966 | { SDLK_RIGHT, 206, 67, 20, "Vol Up" }, | ||
1967 | { SDLK_h, 369, 402, 30, "Hold" }, | ||
1968 | { 0, 0, 0, 0, "None" } | ||
1969 | }; | ||
1970 | #else | ||
1971 | struct button_map bm[] = { | ||
1972 | { 0, 0, 0, 0, ""} | ||
1973 | }; | ||
1974 | #endif | ||
1975 | |||
1976 | static int xy2button( int x, int y) | ||
1977 | { | ||
1978 | int i; | ||
1979 | extern bool debug_buttons; | ||
1980 | |||
1981 | for ( i = 0; bm[i].button; i++ ) | ||
1982 | /* check distance from center of button < radius */ | ||
1983 | if ( ( (x-bm[i].x)*(x-bm[i].x) ) + ( ( y-bm[i].y)*(y-bm[i].y) ) < bm[i].radius*bm[i].radius ) { | ||
1984 | if (debug_buttons) | ||
1985 | printf("Button: %s\n", bm[i].description ); | ||
1986 | return bm[i].button; | ||
1987 | } | ||
1988 | return 0; | ||
1989 | } | ||