diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-06-06 09:11:52 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-06-06 09:11:52 +0000 |
commit | 59d2603c41096b55ca19cdb5dacaf87b3d4f236d (patch) | |
tree | 7dfacc31dd69f49fe04491c554e98bfc1c670d8b | |
parent | 6778fa8608565c44cfc2a27dd115da0d400879cc (diff) | |
download | rockbox-59d2603c41096b55ca19cdb5dacaf87b3d4f236d.tar.gz rockbox-59d2603c41096b55ca19cdb5dacaf87b3d4f236d.zip |
Move target-simulating specific keymaps out of button-sdl.c into a file per
keypad.
Copyright is restored for each keymap according to git blame.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26615 a1c6a512-1295-4272-9138-f99709370657
37 files changed, 2832 insertions, 1660 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 | } | ||
diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES new file mode 100644 index 0000000000..4d99093e7d --- /dev/null +++ b/uisimulator/buttonmap/SOURCES | |||
@@ -0,0 +1,68 @@ | |||
1 | #ifdef SIMULATOR | ||
2 | buttonmaps.c | ||
3 | #ifdef HAVE_TOUCHSCREEN | ||
4 | touchscreen.c | ||
5 | #endif | ||
6 | #if CONFIG_KEYPAD == GIGABEAT_PAD | ||
7 | gigabeat.c | ||
8 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD | ||
9 | gigabeat-s.c | ||
10 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD | ||
11 | iaudio-x5m5.c | ||
12 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | ||
13 | iaudio-m3.c | ||
14 | #elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) \ | ||
15 | || (CONFIG_KEYPAD == IPOD_4G_PAD) | ||
16 | ipod.c | ||
17 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | ||
18 | iriver-h10.c | ||
19 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
20 | iriver-h100_h300.c | ||
21 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
22 | iriver-ifp7xx.c | ||
23 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
24 | archos-ondio.c | ||
25 | #elif CONFIG_KEYPAD == PLAYER_PAD | ||
26 | archos-player.c | ||
27 | #elif CONFIG_KEYPAD == RECORDER_PAD | ||
28 | archos-recorder.c | ||
29 | #elif CONFIG_KEYPAD == ARCHOS_AV300_PAD | ||
30 | archos-av300.c | ||
31 | #elif CONFIG_KEYPAD == SANSA_C200_PAD | ||
32 | sansa-c200.c | ||
33 | #elif CONFIG_KEYPAD == SANSA_CLIP_PAD | ||
34 | sansa-clip.c | ||
35 | #elif CONFIG_KEYPAD == SANSA_E200_PAD | ||
36 | sansa-e200.c | ||
37 | #elif CONFIG_KEYPAD == SANSA_FUZE_PAD | ||
38 | sansa-fuze.c | ||
39 | #elif CONFIG_KEYPAD == SANSA_M200_PAD | ||
40 | sansa-m200.c | ||
41 | #elif CONFIG_KEYPAD == MROBE500_PAD | ||
42 | mrobe500.c | ||
43 | #elif CONFIG_KEYPAD == MROBE100_PAD | ||
44 | mrobe100.c | ||
45 | #elif CONFIG_KEYPAD == COWON_D2_PAD | ||
46 | cowon-d2.c | ||
47 | #elif CONFIG_KEYPAD == IAUDIO67_PAD | ||
48 | iaudio-6_7.c | ||
49 | #elif CONFIG_KEYPAD == CREATIVEZVM_PAD | ||
50 | creative-zvm.c | ||
51 | #elif CONFIG_KEYPAD == MEIZU_M6SL_PAD | ||
52 | meizu-m6sl.c | ||
53 | #elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD | ||
54 | gogear-sa9200.c | ||
55 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD | ||
56 | gogear-hdd1630.c | ||
57 | #elif CONFIG_KEYPAD == ONDAVX747_PAD | ||
58 | onda-vx747.c | ||
59 | #elif CONFIG_KEYPAD == ONDAVX777_PAD | ||
60 | onda-vx777.c | ||
61 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | ||
62 | samsung-yh820_yh925.c | ||
63 | #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD | ||
64 | pbell-vibe500.c | ||
65 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
66 | mpio-hd200.c | ||
67 | #endif | ||
68 | #endif /* SIMULATOR */ | ||
diff --git a/uisimulator/buttonmap/archos-av300.c b/uisimulator/buttonmap/archos-av300.c new file mode 100644 index 0000000000..5f09f7fc3e --- /dev/null +++ b/uisimulator/buttonmap/archos-av300.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 Dave Chapman | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | case SDLK_KP_PLUS: | ||
49 | case SDLK_F8: | ||
50 | new_btn = BUTTON_ON; | ||
51 | break; | ||
52 | case SDLK_KP_ENTER: | ||
53 | case SDLK_RETURN: | ||
54 | case SDLK_a: | ||
55 | new_btn = BUTTON_OFF; | ||
56 | break; | ||
57 | case SDLK_KP_DIVIDE: | ||
58 | case SDLK_F1: | ||
59 | new_btn = BUTTON_F1; | ||
60 | break; | ||
61 | case SDLK_KP_MULTIPLY: | ||
62 | case SDLK_F2: | ||
63 | new_btn = BUTTON_F2; | ||
64 | break; | ||
65 | case SDLK_KP_MINUS: | ||
66 | case SDLK_F3: | ||
67 | new_btn = BUTTON_F3; | ||
68 | break; | ||
69 | case SDLK_KP5: | ||
70 | case SDLK_SPACE: | ||
71 | new_btn = BUTTON_SELECT; | ||
72 | break; | ||
73 | } | ||
74 | return new_btn; | ||
75 | } | ||
76 | |||
77 | |||
78 | struct button_map bm[] = { | ||
79 | { 0, 0, 0, 0, "None" } | ||
80 | }; | ||
81 | |||
diff --git a/uisimulator/buttonmap/archos-ondio.c b/uisimulator/buttonmap/archos-ondio.c new file mode 100644 index 0000000000..f92715ced8 --- /dev/null +++ b/uisimulator/buttonmap/archos-ondio.c | |||
@@ -0,0 +1,69 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Dan Everton | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | case SDLK_KP_ENTER: | ||
49 | case SDLK_RETURN: | ||
50 | case SDLK_a: | ||
51 | new_btn = BUTTON_OFF; | ||
52 | break; | ||
53 | case SDLK_KP_PERIOD: | ||
54 | case SDLK_INSERT: | ||
55 | new_btn = BUTTON_MENU; | ||
56 | break; | ||
57 | } | ||
58 | return new_btn; | ||
59 | } | ||
60 | |||
61 | struct button_map bm[] = { | ||
62 | { SDLK_KP_ENTER, 75, 23, 30, "Enter" }, | ||
63 | { SDLK_KP8, 75, 174, 33, "KP8" }, | ||
64 | { SDLK_KP4, 26, 186, 48, "KP4" }, | ||
65 | { SDLK_KP6, 118, 196, 32, "KP6" }, | ||
66 | { SDLK_KP2, 75, 234, 16, "KP2" }, | ||
67 | { SDLK_KP_PERIOD, 54, 250, 24, "Period" }, | ||
68 | { 0, 0, 0, 0, "None" } | ||
69 | }; | ||
diff --git a/uisimulator/buttonmap/archos-player.c b/uisimulator/buttonmap/archos-player.c new file mode 100644 index 0000000000..3524e7b243 --- /dev/null +++ b/uisimulator/buttonmap/archos-player.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Dan Everton | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_PLAY; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_STOP; | ||
47 | break; | ||
48 | case SDLK_KP_PLUS: | ||
49 | case SDLK_F8: | ||
50 | new_btn = BUTTON_ON; | ||
51 | break; | ||
52 | case SDLK_KP_PERIOD: | ||
53 | case SDLK_INSERT: | ||
54 | new_btn = BUTTON_MENU; | ||
55 | break; | ||
56 | } | ||
57 | return new_btn; | ||
58 | } | ||
59 | |||
60 | struct button_map bm[] = { | ||
61 | { SDLK_KP_PLUS, 79, 252, 23, "On" }, | ||
62 | { SDLK_KP_PERIOD, 81, 310, 20, "Menu" }, | ||
63 | { SDLK_KP8, 154, 237, 28, "Play" }, | ||
64 | { SDLK_KP4, 121, 282, 23, "Left" }, | ||
65 | { SDLK_KP6, 187, 282, 22, "Right" }, | ||
66 | { SDLK_KP2, 157, 312, 20, "Down" }, | ||
67 | { 0, 0, 0, 0, "None" } | ||
68 | }; | ||
diff --git a/uisimulator/buttonmap/archos-recorder.c b/uisimulator/buttonmap/archos-recorder.c new file mode 100644 index 0000000000..cdf98c0814 --- /dev/null +++ b/uisimulator/buttonmap/archos-recorder.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Dan Everton | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "config.h" | ||
25 | #include "button.h" | ||
26 | #include "buttonmap.h" | ||
27 | |||
28 | int key_to_button(int keyboard_button) | ||
29 | { | ||
30 | int new_btn = BUTTON_NONE; | ||
31 | switch (keyboard_button) | ||
32 | { | ||
33 | case SDLK_KP4: | ||
34 | case SDLK_LEFT: | ||
35 | new_btn = BUTTON_LEFT; | ||
36 | break; | ||
37 | case SDLK_KP6: | ||
38 | case SDLK_RIGHT: | ||
39 | new_btn = BUTTON_RIGHT; | ||
40 | break; | ||
41 | case SDLK_KP8: | ||
42 | case SDLK_UP: | ||
43 | new_btn = BUTTON_UP; | ||
44 | break; | ||
45 | case SDLK_KP2: | ||
46 | case SDLK_DOWN: | ||
47 | new_btn = BUTTON_DOWN; | ||
48 | break; | ||
49 | case SDLK_KP_PLUS: | ||
50 | case SDLK_F8: | ||
51 | new_btn = BUTTON_ON; | ||
52 | break; | ||
53 | case SDLK_KP_ENTER: | ||
54 | case SDLK_RETURN: | ||
55 | case SDLK_a: | ||
56 | new_btn = BUTTON_OFF; | ||
57 | break; | ||
58 | case SDLK_KP_DIVIDE: | ||
59 | case SDLK_F1: | ||
60 | new_btn = BUTTON_F1; | ||
61 | break; | ||
62 | case SDLK_KP_MULTIPLY: | ||
63 | case SDLK_F2: | ||
64 | new_btn = BUTTON_F2; | ||
65 | break; | ||
66 | case SDLK_KP_MINUS: | ||
67 | case SDLK_F3: | ||
68 | new_btn = BUTTON_F3; | ||
69 | break; | ||
70 | case SDLK_KP5: | ||
71 | case SDLK_SPACE: | ||
72 | new_btn = BUTTON_PLAY; | ||
73 | break; | ||
74 | } | ||
75 | return new_btn; | ||
76 | } | ||
77 | |||
78 | struct button_map bm[] = { | ||
79 | #if defined (ARCHOS_RECORDER) | ||
80 | { SDLK_F1, 94, 205, 22, "F1" }, | ||
81 | { SDLK_F2, 136, 204, 21, "F2" }, | ||
82 | { SDLK_F3, 174, 204, 24, "F3" }, | ||
83 | { SDLK_KP_PLUS, 75, 258, 19, "On" }, | ||
84 | { SDLK_KP_ENTER, 76, 307, 15, "Off" }, | ||
85 | { SDLK_KP5, 151, 290, 20, "Select" }, | ||
86 | { SDLK_KP8, 152, 251, 23, "Up" }, | ||
87 | { SDLK_KP4, 113, 288, 26, "Left" }, | ||
88 | { SDLK_KP6, 189, 291, 23, "Right" }, | ||
89 | { SDLK_KP2, 150, 327, 27, "Down" }, | ||
90 | #elif defined (ARCHOS_FMRECORDER) || defined (ARCHOS_RECORDERV2) | ||
91 | { SDLK_F1, 88, 210, 28, "F1" }, | ||
92 | { SDLK_F2, 144, 212, 28, "F2" }, | ||
93 | { SDLK_F3, 197, 212, 28, "F3" }, | ||
94 | { SDLK_KP5, 144, 287, 21, "Select" }, | ||
95 | { SDLK_KP_PLUS, 86, 320, 13, "Menu" }, | ||
96 | { SDLK_KP_ENTER, 114, 347, 13, "Stop" }, | ||
97 | { SDLK_y, 144, 288, 31, "None" }, | ||
98 | { SDLK_KP8, 144, 259, 25, "Up" }, | ||
99 | { SDLK_KP2, 144, 316, 31, "Down" }, | ||
100 | { SDLK_KP6, 171, 287, 32, "Right" }, | ||
101 | #endif | ||
102 | { SDLK_KP4, 117, 287, 31, "Left" }, | ||
103 | { 0, 0, 0, 0, "None" } | ||
104 | }; | ||
diff --git a/uisimulator/buttonmap/buttonmap.h b/uisimulator/buttonmap/buttonmap.h new file mode 100644 index 0000000000..d5b951af9b --- /dev/null +++ b/uisimulator/buttonmap/buttonmap.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 by Fred Bauer | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __BUTTONMAP_H__ | ||
23 | #define __BUTTONMAP_H__ | ||
24 | /* Button maps: simulated key, x, y, radius, name */ | ||
25 | /* Run sim with --mapping to get coordinates */ | ||
26 | /* or --debugbuttons to check */ | ||
27 | /* The First matching button is returned */ | ||
28 | struct button_map { | ||
29 | int button, x, y, radius; | ||
30 | char *description; | ||
31 | }; | ||
32 | |||
33 | extern struct button_map bm[]; | ||
34 | |||
35 | int xy2button( int x, int y); | ||
36 | |||
37 | int key_to_button(int keyboard_button); | ||
38 | #ifdef HAVE_TOUCHSCREEN | ||
39 | int key_to_touch(int keyboard_button); | ||
40 | #endif | ||
41 | |||
42 | #endif /* __BUTTONMAP_H__ */ | ||
diff --git a/uisimulator/buttonmap/buttonmaps.c b/uisimulator/buttonmap/buttonmaps.c new file mode 100644 index 0000000000..b015a26020 --- /dev/null +++ b/uisimulator/buttonmap/buttonmaps.c | |||
@@ -0,0 +1,40 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 by Fred Bauer | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | #include <stdio.h> | ||
24 | #include "buttonmap.h" | ||
25 | #include "config.h" | ||
26 | |||
27 | int xy2button( int x, int y) | ||
28 | { | ||
29 | int i; | ||
30 | extern bool debug_buttons; | ||
31 | |||
32 | for ( i = 0; bm[i].button; i++ ) | ||
33 | /* check distance from center of button < radius */ | ||
34 | if ( ( (x-bm[i].x)*(x-bm[i].x) ) + ( ( y-bm[i].y)*(y-bm[i].y) ) < bm[i].radius*bm[i].radius ) { | ||
35 | if (debug_buttons) | ||
36 | printf("Button: %s\n", bm[i].description ); | ||
37 | return bm[i].button; | ||
38 | } | ||
39 | return 0; | ||
40 | } | ||
diff --git a/uisimulator/buttonmap/cowon-d2.c b/uisimulator/buttonmap/cowon-d2.c new file mode 100644 index 0000000000..f08905e648 --- /dev/null +++ b/uisimulator/buttonmap/cowon-d2.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Rob Purchase | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP_MULTIPLY: | ||
33 | case SDLK_F8: | ||
34 | case SDLK_ESCAPE: | ||
35 | case SDLK_BACKSPACE: | ||
36 | case SDLK_DELETE: | ||
37 | new_btn = BUTTON_POWER; | ||
38 | break; | ||
39 | case SDLK_KP_PLUS: | ||
40 | case SDLK_EQUALS: | ||
41 | new_btn = BUTTON_PLUS; | ||
42 | break; | ||
43 | case SDLK_KP_MINUS: | ||
44 | case SDLK_MINUS: | ||
45 | new_btn = BUTTON_MINUS; | ||
46 | break; | ||
47 | case SDLK_KP_ENTER: | ||
48 | case SDLK_RETURN: | ||
49 | case SDLK_SPACE: | ||
50 | case SDLK_INSERT: | ||
51 | new_btn = BUTTON_MENU; | ||
52 | break; | ||
53 | } | ||
54 | return new_btn; | ||
55 | } | ||
56 | |||
57 | struct button_map bm[] = { | ||
58 | { SDLK_DELETE, 51, 14, 17, "Power" }, | ||
59 | { SDLK_h, 138, 14, 16, "Hold" }, | ||
60 | { SDLK_MINUS, 320, 14, 10, "Minus" }, | ||
61 | { SDLK_INSERT, 347, 13, 13, "Menu" }, | ||
62 | { SDLK_KP_PLUS, 374, 14, 12, "Plus" }, | ||
63 | { 0, 0, 0, 0, "None" } | ||
64 | }; | ||
diff --git a/uisimulator/buttonmap/creative-zv.c b/uisimulator/buttonmap/creative-zv.c new file mode 100644 index 0000000000..2adc9380e4 --- /dev/null +++ b/uisimulator/buttonmap/creative-zv.c | |||
@@ -0,0 +1,92 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Maurus Cuelenaere | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP1: | ||
33 | new_btn = BUTTON_PREV; | ||
34 | break; | ||
35 | case SDLK_KP3: | ||
36 | new_btn = BUTTON_NEXT; | ||
37 | break; | ||
38 | case SDLK_KP7: | ||
39 | new_btn = BUTTON_BACK; | ||
40 | break; | ||
41 | case SDLK_p: | ||
42 | new_btn = BUTTON_PLAY; | ||
43 | break; | ||
44 | case SDLK_KP9: | ||
45 | new_btn = BUTTON_MENU; | ||
46 | break; | ||
47 | case SDLK_KP4: | ||
48 | case SDLK_LEFT: | ||
49 | new_btn = BUTTON_LEFT; | ||
50 | break; | ||
51 | case SDLK_KP6: | ||
52 | case SDLK_RIGHT: | ||
53 | new_btn = BUTTON_RIGHT; | ||
54 | break; | ||
55 | case SDLK_KP8: | ||
56 | case SDLK_UP: | ||
57 | new_btn = BUTTON_UP; | ||
58 | break; | ||
59 | case SDLK_KP2: | ||
60 | case SDLK_DOWN: | ||
61 | new_btn = BUTTON_DOWN; | ||
62 | break; | ||
63 | case SDLK_KP5: | ||
64 | case SDLK_SPACE: | ||
65 | new_btn = BUTTON_SELECT; | ||
66 | break; | ||
67 | case SDLK_KP_MULTIPLY: | ||
68 | case SDLK_F8: | ||
69 | case SDLK_ESCAPE: | ||
70 | new_btn = BUTTON_POWER; | ||
71 | break; | ||
72 | case SDLK_z: | ||
73 | new_btn = BUTTON_VOL_DOWN; | ||
74 | break; | ||
75 | case SDLK_s: | ||
76 | new_btn = BUTTON_VOL_UP; | ||
77 | break; | ||
78 | } | ||
79 | return new_btn; | ||
80 | } | ||
81 | |||
82 | struct button_map bm[] = { | ||
83 | { SDLK_KP7, 52, 414, 35, "Custom" }, | ||
84 | { SDLK_KP8, 185, 406, 55, "Up" }, | ||
85 | { SDLK_KP9, 315, 421, 46, "Play" }, | ||
86 | { SDLK_KP4, 122, 500, 41, "Left" }, | ||
87 | { SDLK_KP6, 247, 493, 49, "Right" }, | ||
88 | { SDLK_KP1, 58, 577, 49, "Back" }, | ||
89 | { SDLK_KP2, 186, 585, 46, "Down" }, | ||
90 | { SDLK_KP3, 311, 569, 47, "Menu" }, | ||
91 | { 0, 0, 0, 0, "None" } | ||
92 | }; | ||
diff --git a/uisimulator/buttonmap/creative-zvm.c b/uisimulator/buttonmap/creative-zvm.c new file mode 100644 index 0000000000..0efbcccc98 --- /dev/null +++ b/uisimulator/buttonmap/creative-zvm.c | |||
@@ -0,0 +1,83 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Maurus Cuelenaere | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP1: | ||
33 | new_btn = BUTTON_BACK; | ||
34 | break; | ||
35 | case SDLK_KP3: | ||
36 | new_btn = BUTTON_MENU; | ||
37 | break; | ||
38 | case SDLK_KP7: | ||
39 | new_btn = BUTTON_CUSTOM; | ||
40 | break; | ||
41 | case SDLK_KP9: | ||
42 | new_btn = BUTTON_PLAY; | ||
43 | break; | ||
44 | case SDLK_KP4: | ||
45 | case SDLK_LEFT: | ||
46 | new_btn = BUTTON_LEFT; | ||
47 | break; | ||
48 | case SDLK_KP6: | ||
49 | case SDLK_RIGHT: | ||
50 | new_btn = BUTTON_RIGHT; | ||
51 | break; | ||
52 | case SDLK_KP8: | ||
53 | case SDLK_UP: | ||
54 | new_btn = BUTTON_UP; | ||
55 | break; | ||
56 | case SDLK_KP2: | ||
57 | case SDLK_DOWN: | ||
58 | new_btn = BUTTON_DOWN; | ||
59 | break; | ||
60 | case SDLK_KP5: | ||
61 | case SDLK_SPACE: | ||
62 | new_btn = BUTTON_SELECT; | ||
63 | break; | ||
64 | case SDLK_KP_MULTIPLY: | ||
65 | case SDLK_F8: | ||
66 | case SDLK_ESCAPE: | ||
67 | new_btn = BUTTON_POWER; | ||
68 | break; | ||
69 | } | ||
70 | return new_btn; | ||
71 | } | ||
72 | |||
73 | struct button_map bm[] = { | ||
74 | { SDLK_KP7, 52, 414, 35, "Custom" }, | ||
75 | { SDLK_KP8, 185, 406, 55, "Up" }, | ||
76 | { SDLK_KP9, 315, 421, 46, "Play" }, | ||
77 | { SDLK_KP4, 122, 500, 41, "Left" }, | ||
78 | { SDLK_KP6, 247, 493, 49, "Right" }, | ||
79 | { SDLK_KP1, 58, 577, 49, "Back" }, | ||
80 | { SDLK_KP2, 186, 585, 46, "Down" }, | ||
81 | { SDLK_KP3, 311, 569, 47, "Menu" }, | ||
82 | { 0, 0, 0, 0, "None" } | ||
83 | }; | ||
diff --git a/uisimulator/buttonmap/gigabeat-s.c b/uisimulator/buttonmap/gigabeat-s.c new file mode 100644 index 0000000000..98a8489446 --- /dev/null +++ b/uisimulator/buttonmap/gigabeat-s.c | |||
@@ -0,0 +1,79 @@ | |||
1 | n/*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Will Robertson | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | int key_to_button(int keyboard_button) | ||
24 | { | ||
25 | int new_btn = BUTTON_NONE; | ||
26 | switch (keyboard_button) | ||
27 | { | ||
28 | case SDLK_KP4: | ||
29 | case SDLK_LEFT: | ||
30 | new_btn = BUTTON_LEFT; | ||
31 | break; | ||
32 | case SDLK_KP6: | ||
33 | case SDLK_RIGHT: | ||
34 | new_btn = BUTTON_RIGHT; | ||
35 | break; | ||
36 | case SDLK_KP8: | ||
37 | case SDLK_UP: | ||
38 | new_btn = BUTTON_UP; | ||
39 | break; | ||
40 | case SDLK_KP2: | ||
41 | case SDLK_DOWN: | ||
42 | new_btn = BUTTON_DOWN; | ||
43 | break; | ||
44 | case SDLK_F8: | ||
45 | case SDLK_ESCAPE: | ||
46 | new_btn = BUTTON_POWER; | ||
47 | break; | ||
48 | case SDLK_KP_PLUS: | ||
49 | case SDLK_KP_ENTER: | ||
50 | case SDLK_RETURN: | ||
51 | new_btn = BUTTON_PLAY; | ||
52 | break; | ||
53 | case SDLK_KP7: | ||
54 | new_btn = BUTTON_BACK; | ||
55 | break; | ||
56 | case SDLK_KP5: | ||
57 | case SDLK_SPACE: | ||
58 | new_btn = BUTTON_SELECT; | ||
59 | break; | ||
60 | case SDLK_KP9: | ||
61 | case SDLK_KP_PERIOD: | ||
62 | case SDLK_INSERT: | ||
63 | new_btn = BUTTON_MENU; | ||
64 | break; | ||
65 | } | ||
66 | return new_btn; | ||
67 | } | ||
68 | |||
69 | struct button_map bm[] = { | ||
70 | { SDLK_KP_PLUS, 416, 383, 23, "Play" }, | ||
71 | { SDLK_KP7, 135, 442, 46, "Back" }, | ||
72 | { SDLK_KP9, 288, 447, 35, "Menu" }, | ||
73 | { SDLK_KP8, 214, 480, 32, "Up" }, | ||
74 | { SDLK_KP4, 128, 558, 33, "Left" }, | ||
75 | { SDLK_KP5, 214, 556, 34, "Select" }, | ||
76 | { SDLK_KP6, 293, 558, 35, "Right" }, | ||
77 | { SDLK_KP2, 214, 637, 38, "Down" }, | ||
78 | { 0, 0, 0, 0, "None" } | ||
79 | }; | ||
diff --git a/uisimulator/buttonmap/gigabeat.c b/uisimulator/buttonmap/gigabeat.c new file mode 100644 index 0000000000..02055cf0b9 --- /dev/null +++ b/uisimulator/buttonmap/gigabeat.c | |||
@@ -0,0 +1,90 @@ | |||
1 | n/*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | case SDLK_KP_PLUS: | ||
49 | case SDLK_F8: | ||
50 | new_btn = BUTTON_POWER; | ||
51 | break; | ||
52 | case SDLK_ESCAPE: | ||
53 | new_btn = BUTTON_POWER; | ||
54 | break; | ||
55 | case SDLK_KP_ENTER: | ||
56 | case SDLK_RETURN: | ||
57 | case SDLK_a: | ||
58 | new_btn = BUTTON_A; | ||
59 | break; | ||
60 | case SDLK_KP5: | ||
61 | case SDLK_SPACE: | ||
62 | new_btn = BUTTON_SELECT; | ||
63 | break; | ||
64 | case SDLK_KP_PERIOD: | ||
65 | case SDLK_INSERT: | ||
66 | new_btn = BUTTON_MENU; | ||
67 | break; | ||
68 | case SDLK_KP9: | ||
69 | new_btn = BUTTON_VOL_UP; | ||
70 | break; | ||
71 | case SDLK_KP3: | ||
72 | new_btn = BUTTON_VOL_DOWN; | ||
73 | break; | ||
74 | } | ||
75 | return new_btn; | ||
76 | } | ||
77 | |||
78 | struct button_map bm[] = { | ||
79 | { SDLK_KP_PLUS, 361, 187, 22, "Power" }, | ||
80 | { SDLK_KP_PERIOD, 361, 270, 17, "Menu" }, | ||
81 | { SDLK_KP9, 365, 345, 26, "Vol Up" }, | ||
82 | { SDLK_KP3, 363, 433, 25, "Vol Down" }, | ||
83 | { SDLK_KP_ENTER, 365, 520, 19, "A" }, | ||
84 | { SDLK_KP8, 167, 458, 35, "Up" }, | ||
85 | { SDLK_KP4, 86, 537, 29, "Left" }, | ||
86 | { SDLK_KP5, 166, 536, 30, "Select" }, | ||
87 | { SDLK_KP6, 248, 536, 30, "Right" }, | ||
88 | { SDLK_KP2, 169, 617, 28, "Down" }, | ||
89 | { 0, 0, 0, 0, "None" } | ||
90 | }; | ||
diff --git a/uisimulator/buttonmap/gogear-hdd1630.c b/uisimulator/buttonmap/gogear-hdd1630.c new file mode 100644 index 0000000000..fea4e56a9f --- /dev/null +++ b/uisimulator/buttonmap/gogear-hdd1630.c | |||
@@ -0,0 +1,77 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Mark Arigo | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | case SDLK_KP5: | ||
49 | case SDLK_SPACE: | ||
50 | new_btn = BUTTON_SELECT; | ||
51 | break; | ||
52 | case SDLK_KP7: | ||
53 | case SDLK_ESCAPE: | ||
54 | new_btn = BUTTON_POWER; | ||
55 | break; | ||
56 | case SDLK_KP1: | ||
57 | new_btn = BUTTON_PLAYLIST; | ||
58 | break; | ||
59 | case SDLK_KP9: | ||
60 | new_btn = BUTTON_VOL_UP; | ||
61 | break; | ||
62 | case SDLK_KP3: | ||
63 | new_btn = BUTTON_VOL_DOWN; | ||
64 | break; | ||
65 | case SDLK_KP_MINUS: | ||
66 | new_btn = BUTTON_MENU; | ||
67 | break; | ||
68 | case SDLK_KP_PLUS: | ||
69 | new_btn = BUTTON_VIEW; | ||
70 | break; | ||
71 | } | ||
72 | return new_btn; | ||
73 | } | ||
74 | |||
75 | struct button_map bm[] = { | ||
76 | { 0, 0, 0, 0, "None" } | ||
77 | }; | ||
diff --git a/uisimulator/buttonmap/gogear-sa9200.c b/uisimulator/buttonmap/gogear-sa9200.c new file mode 100644 index 0000000000..ef06f0dd28 --- /dev/null +++ b/uisimulator/buttonmap/gogear-sa9200.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Mark Arigo | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | case SDLK_KP1: | ||
49 | new_btn = BUTTON_MENU; | ||
50 | break; | ||
51 | case SDLK_KP5: | ||
52 | case SDLK_SPACE: | ||
53 | new_btn = BUTTON_PLAY; | ||
54 | break; | ||
55 | case SDLK_KP7: | ||
56 | new_btn = BUTTON_PREV; | ||
57 | break; | ||
58 | case SDLK_KP9: | ||
59 | new_btn = BUTTON_NEXT; | ||
60 | break; | ||
61 | case SDLK_KP_ENTER: | ||
62 | case SDLK_RETURN: | ||
63 | new_btn = BUTTON_POWER; | ||
64 | break; | ||
65 | case SDLK_PAGEUP: | ||
66 | new_btn = BUTTON_VOL_UP; | ||
67 | break; | ||
68 | case SDLK_PAGEDOWN: | ||
69 | new_btn = BUTTON_VOL_DOWN; | ||
70 | break; | ||
71 | } | ||
72 | return new_btn; | ||
73 | } | ||
74 | |||
75 | struct button_map bm[] = { | ||
76 | { SDLK_KP_ENTER, 25, 155, 33, "Power" }, | ||
77 | { SDLK_PAGEUP, 210, 98, 31, "Vol Up" }, | ||
78 | { SDLK_PAGEDOWN, 210, 168, 34, "Vol Down" }, | ||
79 | { SDLK_KP7, 40, 249, 26, "Prev" }, | ||
80 | { SDLK_KP8, 110, 247, 22, "Up" }, | ||
81 | { SDLK_KP9, 183, 249, 31, "Next" }, | ||
82 | { SDLK_KP4, 45, 305, 25, "Left" }, | ||
83 | { SDLK_KP5, 111, 304, 24, "Play" }, | ||
84 | { SDLK_KP6, 183, 304, 21, "Right" }, | ||
85 | { SDLK_KP1, 43, 377, 21, "Menu" }, | ||
86 | { SDLK_KP2, 112, 371, 24, "Down" }, | ||
87 | { 0, 0, 0, 0, "None" } | ||
88 | }; | ||
diff --git a/uisimulator/buttonmap/iaudio-6_7.c b/uisimulator/buttonmap/iaudio-6_7.c new file mode 100644 index 0000000000..82ec78ce99 --- /dev/null +++ b/uisimulator/buttonmap/iaudio-6_7.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Vitja Makarov | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_UP: | ||
33 | new_btn = BUTTON_RIGHT; | ||
34 | break; | ||
35 | case SDLK_DOWN: | ||
36 | new_btn = BUTTON_LEFT; | ||
37 | break; | ||
38 | case SDLK_LEFT: | ||
39 | new_btn = BUTTON_STOP; | ||
40 | break; | ||
41 | case SDLK_RETURN: | ||
42 | case SDLK_KP_ENTER: | ||
43 | case SDLK_RIGHT: | ||
44 | new_btn = BUTTON_PLAY; | ||
45 | break; | ||
46 | case SDLK_PLUS: | ||
47 | new_btn = BUTTON_VOLUP; | ||
48 | break; | ||
49 | case SDLK_MINUS: | ||
50 | new_btn = BUTTON_VOLDOWN; | ||
51 | break; | ||
52 | case SDLK_SPACE: | ||
53 | new_btn = BUTTON_MENU; | ||
54 | break; | ||
55 | case SDLK_BACKSPACE: | ||
56 | new_btn = BUTTON_POWER; | ||
57 | break; | ||
58 | } | ||
59 | return new_btn; | ||
60 | } | ||
61 | |||
62 | struct button_map bm[] = { | ||
63 | { 0, 0, 0, 0, "None" } | ||
64 | }; | ||
diff --git a/uisimulator/buttonmap/iaudio-x5_m5.c b/uisimulator/buttonmap/iaudio-x5_m5.c new file mode 100644 index 0000000000..9bab1df94b --- /dev/null +++ b/uisimulator/buttonmap/iaudio-x5_m5.c | |||
@@ -0,0 +1,96 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "config.h" | ||
26 | #include "buttonmap.h" | ||
27 | |||
28 | int key_to_button(int keyboard_button) | ||
29 | { | ||
30 | int new_btn = BUTTON_NONE; | ||
31 | switch (keyboard_button) | ||
32 | { | ||
33 | case SDLK_KP4: | ||
34 | case SDLK_LEFT: | ||
35 | new_btn = BUTTON_LEFT; | ||
36 | break; | ||
37 | case SDLK_KP6: | ||
38 | case SDLK_RIGHT: | ||
39 | new_btn = BUTTON_RIGHT; | ||
40 | break; | ||
41 | case SDLK_KP8: | ||
42 | case SDLK_UP: | ||
43 | new_btn = BUTTON_UP; | ||
44 | break; | ||
45 | case SDLK_KP2: | ||
46 | case SDLK_DOWN: | ||
47 | new_btn = BUTTON_DOWN; | ||
48 | break; | ||
49 | case SDLK_KP_PLUS: | ||
50 | case SDLK_F8: | ||
51 | new_btn = BUTTON_PLAY; | ||
52 | break; | ||
53 | case SDLK_ESCAPE: | ||
54 | new_btn = BUTTON_POWER; | ||
55 | break; | ||
56 | case SDLK_KP_ENTER: | ||
57 | case SDLK_RETURN: | ||
58 | case SDLK_a: | ||
59 | new_btn = BUTTON_POWER; | ||
60 | break; | ||
61 | case SDLK_KP_DIVIDE: | ||
62 | case SDLK_F1: | ||
63 | new_btn = BUTTON_REC; | ||
64 | break; | ||
65 | case SDLK_KP5: | ||
66 | case SDLK_SPACE: | ||
67 | new_btn = BUTTON_SELECT; | ||
68 | break; | ||
69 | } | ||
70 | return new_btn; | ||
71 | } | ||
72 | |||
73 | struct button_map bm[] = { | ||
74 | #if defined (IAUDIO_M5) | ||
75 | { SDLK_KP_ENTER, 333, 41, 17, "Enter" }, | ||
76 | { SDLK_h, 334, 74, 21, "Hold" }, | ||
77 | { SDLK_KP_DIVIDE, 333, 142, 24, "Record" }, | ||
78 | { SDLK_KP_PLUS, 332, 213, 20, "Play" }, | ||
79 | { SDLK_KP5, 250, 291, 19, "Select" }, | ||
80 | { SDLK_KP8, 249, 236, 32, "Up" }, | ||
81 | { SDLK_KP4, 194, 292, 29, "Left" }, | ||
82 | { SDLK_KP6, 297, 290, 27, "Right" }, | ||
83 | { SDLK_KP2, 252, 335, 28, "Down" }, | ||
84 | #elif defined (IAUDIO_X5) | ||
85 | { SDLK_KP_ENTER, 275, 38, 17, "Power" }, | ||
86 | { SDLK_h, 274, 83, 16, "Hold" }, | ||
87 | { SDLK_KP_DIVIDE, 276, 128, 22, "Record" }, | ||
88 | { SDLK_KP_PLUS, 274, 186, 22, "Play" }, | ||
89 | { SDLK_KP5, 200, 247, 16, "Select" }, | ||
90 | { SDLK_KP8, 200, 206, 16, "Up" }, | ||
91 | { SDLK_KP4, 163, 248, 19, "Left" }, | ||
92 | { SDLK_KP6, 225, 247, 24, "Right" }, | ||
93 | { SDLK_KP2, 199, 279, 20, "Down" }, | ||
94 | #endif | ||
95 | { 0, 0, 0, 0, "None" } | ||
96 | }; | ||
diff --git a/uisimulator/buttonmap/iaudo-m3.c b/uisimulator/buttonmap/iaudo-m3.c new file mode 100644 index 0000000000..1ab1392f47 --- /dev/null +++ b/uisimulator/buttonmap/iaudo-m3.c | |||
@@ -0,0 +1,101 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Jens Arnold | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | new_btn = BUTTON_LEFT; | ||
34 | break; | ||
35 | case SDLK_LEFT: | ||
36 | new_btn = BUTTON_RC_REW; | ||
37 | break; | ||
38 | case SDLK_KP6: | ||
39 | new_btn = BUTTON_RIGHT; | ||
40 | break; | ||
41 | case SDLK_RIGHT: | ||
42 | new_btn = BUTTON_RC_FF; | ||
43 | break; | ||
44 | case SDLK_KP8: | ||
45 | new_btn = BUTTON_VOL_UP; | ||
46 | break; | ||
47 | case SDLK_UP: | ||
48 | new_btn = BUTTON_RC_VOL_UP; | ||
49 | break; | ||
50 | case SDLK_KP2: | ||
51 | new_btn = BUTTON_VOL_DOWN; | ||
52 | break; | ||
53 | case SDLK_DOWN: | ||
54 | new_btn = BUTTON_RC_VOL_DOWN; | ||
55 | break; | ||
56 | case SDLK_KP_PERIOD: | ||
57 | new_btn = BUTTON_MODE; | ||
58 | break; | ||
59 | case SDLK_INSERT: | ||
60 | new_btn = BUTTON_RC_MODE; | ||
61 | break; | ||
62 | case SDLK_KP_DIVIDE: | ||
63 | new_btn = BUTTON_REC; | ||
64 | break; | ||
65 | case SDLK_F1: | ||
66 | new_btn = BUTTON_RC_REC; | ||
67 | break; | ||
68 | case SDLK_KP5: | ||
69 | new_btn = BUTTON_PLAY; | ||
70 | break; | ||
71 | case SDLK_SPACE: | ||
72 | new_btn = BUTTON_RC_PLAY; | ||
73 | break; | ||
74 | case SDLK_KP_ENTER: | ||
75 | case SDLK_RETURN: | ||
76 | new_btn = BUTTON_RC_MENU; | ||
77 | break; | ||
78 | } | ||
79 | return new_btn; | ||
80 | } | ||
81 | |||
82 | struct button_map bm[] = { | ||
83 | { SDLK_KP5, 256, 72, 29, "Play" }, | ||
84 | { SDLK_KP6, 255, 137, 28, "Right" }, | ||
85 | { SDLK_KP4, 257, 201, 26, "Left" }, | ||
86 | { SDLK_KP8, 338, 31, 27, "Up" }, | ||
87 | { SDLK_KP2, 339, 92, 23, "Down" }, | ||
88 | { SDLK_KP_PERIOD, 336, 50, 23, "Mode" }, | ||
89 | { SDLK_KP_DIVIDE, 336, 147, 23, "Rec" }, | ||
90 | { SDLK_h, 336, 212, 30, "Hold" }, | ||
91 | /* remote */ | ||
92 | { SDLK_SPACE, 115, 308, 20, "RC Play" }, | ||
93 | { SDLK_RIGHT, 85, 308, 20, "RC Rew" }, | ||
94 | { SDLK_LEFT, 143, 308, 20, "RC FF" }, | ||
95 | { SDLK_UP, 143, 498, 20, "RC Up" }, | ||
96 | { SDLK_DOWN, 85, 498, 20, "RC Down" }, | ||
97 | { SDLK_INSERT, 212, 308, 30, "RC Mode" }, | ||
98 | { SDLK_F1, 275, 308, 25, "RC Rec" }, | ||
99 | { SDLK_KP_ENTER, 115, 498, 20, "RC Menu" }, | ||
100 | { 0, 0, 0, 0, "None" } | ||
101 | }; | ||
diff --git a/uisimulator/buttonmap/ipod.c b/uisimulator/buttonmap/ipod.c new file mode 100644 index 0000000000..504b77b8dd --- /dev/null +++ b/uisimulator/buttonmap/ipod.c | |||
@@ -0,0 +1,136 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "config.h" | ||
26 | #include "buttonmap.h" | ||
27 | |||
28 | int key_to_button(int keyboard_button) | ||
29 | { | ||
30 | int new_btn = BUTTON_NONE; | ||
31 | switch (keyboard_button) | ||
32 | { | ||
33 | case SDLK_KP4: | ||
34 | case SDLK_LEFT: | ||
35 | new_btn = BUTTON_LEFT; | ||
36 | break; | ||
37 | case SDLK_KP6: | ||
38 | case SDLK_RIGHT: | ||
39 | new_btn = BUTTON_RIGHT; | ||
40 | break; | ||
41 | case SDLK_KP8: | ||
42 | case SDLK_UP: | ||
43 | new_btn = BUTTON_SCROLL_BACK; | ||
44 | break; | ||
45 | case SDLK_KP2: | ||
46 | case SDLK_DOWN: | ||
47 | new_btn = BUTTON_SCROLL_FWD; | ||
48 | break; | ||
49 | case SDLK_KP_PLUS: | ||
50 | case SDLK_F8: | ||
51 | new_btn = BUTTON_PLAY; | ||
52 | break; | ||
53 | case SDLK_KP5: | ||
54 | case SDLK_SPACE: | ||
55 | new_btn = BUTTON_SELECT; | ||
56 | break; | ||
57 | case SDLK_KP_PERIOD: | ||
58 | case SDLK_INSERT: | ||
59 | new_btn = BUTTON_MENU; | ||
60 | break; | ||
61 | } | ||
62 | return new_btn; | ||
63 | } | ||
64 | |||
65 | struct button_map bm[] = { | ||
66 | #if defined (IPOD_VIDEO) | ||
67 | { SDLK_KP_PERIOD, 174, 350, 35, "Menu" }, | ||
68 | { SDLK_KP8, 110, 380, 33, "Scroll Back" }, | ||
69 | { SDLK_KP2, 234, 377, 34, "Scroll Fwd" }, | ||
70 | { SDLK_KP4, 78, 438, 47, "Left" }, | ||
71 | { SDLK_KP5, 172, 435, 43, "Select" }, | ||
72 | { SDLK_KP6, 262, 438, 52, "Right" }, | ||
73 | { SDLK_KP_PLUS, 172, 519, 43, "Play" }, | ||
74 | #elif defined (IPOD_MINI) || defined(IPOD_MINI2G) | ||
75 | { SDLK_KP5, 92, 267, 29, "Select" }, | ||
76 | { SDLK_KP4, 31, 263, 37, "Left" }, | ||
77 | { SDLK_KP6, 150, 268, 33, "Right" }, | ||
78 | { SDLK_KP_PERIOD, 93, 209, 30, "Menu" }, | ||
79 | { SDLK_KP_PLUS, 93, 324, 25, "Play" }, | ||
80 | { SDLK_KP8, 53, 220, 29, "Scroll Back" }, | ||
81 | { SDLK_KP2, 134, 219, 31, "Scroll Fwd" }, | ||
82 | #elif defined (IPOD_3G) | ||
83 | { SDLK_KP5, 108, 296, 26, "Select" }, | ||
84 | { SDLK_KP8, 70, 255, 26, "Scroll Back" }, | ||
85 | { SDLK_KP2, 149, 256, 28, "Scroll Fwd" }, | ||
86 | { SDLK_KP4, 27, 186, 22, "Left" }, | ||
87 | { SDLK_KP_PERIOD, 82, 185, 22, "Menu" }, | ||
88 | { SDLK_KP_PERIOD, 133, 185, 21, "Play" }, | ||
89 | { SDLK_KP6, 189, 188, 21, "Right" }, | ||
90 | #elif defined (IPOD_4G) | ||
91 | { SDLK_KP5, 96, 269, 27, "Select" }, | ||
92 | { SDLK_KP4, 39, 267, 30, "Left" }, | ||
93 | { SDLK_KP6, 153, 270, 27, "Right" }, | ||
94 | { SDLK_KP_PERIOD, 96, 219, 30, "Menu" }, | ||
95 | { SDLK_KP_PLUS, 95, 326, 27, "Play" }, | ||
96 | { SDLK_KP8, 57, 233, 29, "Scroll Back" }, | ||
97 | { SDLK_KP2, 132, 226, 29, "Scroll Fwd" }, | ||
98 | #elif defined (IPOD_COLOR) | ||
99 | { SDLK_KP5, 128, 362, 35, "Select" }, | ||
100 | { SDLK_KP4, 55, 358, 38, "Left" }, | ||
101 | { SDLK_KP6, 203, 359, 39, "Right" }, | ||
102 | { SDLK_KP_PERIOD, 128, 282, 34, "Menu" }, | ||
103 | { SDLK_KP_PLUS, 129, 439, 41, "Play" }, | ||
104 | { SDLK_KP8, 76, 309, 34, "Scroll Back" }, | ||
105 | { SDLK_KP2, 182, 311, 45, "Scroll Fwd" }, | ||
106 | #elif defined (IPOD_1G2G) | ||
107 | { SDLK_KP5, 112, 265, 31, "Select" }, | ||
108 | { SDLK_KP8, 74, 224, 28, "Scroll Back" }, | ||
109 | { SDLK_KP2, 146, 228, 28, "Scroll Fwd" }, | ||
110 | /* Dummy button to make crescent shape */ | ||
111 | { SDLK_y, 112, 265, 76, "None" }, | ||
112 | { SDLK_KP8, 74, 224, 28, "Scroll Back" }, | ||
113 | { SDLK_KP2, 146, 228, 28, "Scroll Fwd" }, | ||
114 | { SDLK_KP6, 159, 268, 64, "Right" }, | ||
115 | { SDLK_KP4, 62, 266, 62, "Left" }, | ||
116 | { SDLK_KP_PERIOD, 111, 216, 64, "Menu" }, | ||
117 | { SDLK_KP_PLUS, 111, 326, 55, "Down" }, | ||
118 | #elif defined (IPOD_NANO) | ||
119 | { SDLK_KP5, 98, 316, 37, "Select" }, | ||
120 | { SDLK_KP4, 37, 312, 28, "Left" }, | ||
121 | { SDLK_KP6, 160, 313, 25, "Right" }, | ||
122 | { SDLK_KP_PERIOD,102, 256, 23, "Menu" }, | ||
123 | { SDLK_KP_PLUS, 99, 378, 28, "Play" }, | ||
124 | { SDLK_KP8, 58, 272, 24, "Scroll Back" }, | ||
125 | { SDLK_KP2, 141, 274, 22, "Scroll Fwd" }, | ||
126 | #elif defined (IPOD_NANO2G) | ||
127 | { SDLK_KP5, 118, 346, 37, "Select" }, | ||
128 | { SDLK_KP4, 51, 345, 28, "Left" }, | ||
129 | { SDLK_KP6, 180, 346, 26, "Right" }, | ||
130 | { SDLK_KP_PERIOD, 114, 286, 23, "Menu" }, | ||
131 | { SDLK_KP_PLUS, 115, 412, 27, "Down" }, | ||
132 | { SDLK_KP8, 67, 303, 28, "Scroll Back" }, | ||
133 | { SDLK_KP2, 163, 303, 27, "Scroll Fwd" }, | ||
134 | #endif | ||
135 | { 0, 0, 0 , 0, "None" } | ||
136 | }; | ||
diff --git a/uisimulator/buttonmap/iriver-h10.c b/uisimulator/buttonmap/iriver-h10.c new file mode 100644 index 0000000000..24dbe83192 --- /dev/null +++ b/uisimulator/buttonmap/iriver-h10.c | |||
@@ -0,0 +1,92 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include <SDL.h> | ||
23 | #include "config.h" | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_SCROLL_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_SCROLL_DOWN; | ||
47 | break; | ||
48 | case SDLK_KP_PLUS: | ||
49 | case SDLK_F8: | ||
50 | new_btn = BUTTON_POWER; | ||
51 | break; | ||
52 | case SDLK_ESCAPE: | ||
53 | new_btn = BUTTON_POWER; | ||
54 | break; | ||
55 | case SDLK_KP_DIVIDE: | ||
56 | case SDLK_F1: | ||
57 | new_btn = BUTTON_REW; | ||
58 | break; | ||
59 | case SDLK_KP_MULTIPLY: | ||
60 | case SDLK_F2: | ||
61 | new_btn = BUTTON_FF; | ||
62 | break; | ||
63 | case SDLK_KP5: | ||
64 | case SDLK_SPACE: | ||
65 | new_btn = BUTTON_PLAY; | ||
66 | break; | ||
67 | } | ||
68 | return new_btn; | ||
69 | } | ||
70 | |||
71 | struct button_map bm[] = { | ||
72 | #if defined (IRIVER_H10) | ||
73 | { SDLK_KP_PLUS, 38, 70, 37, "Power" }, | ||
74 | { SDLK_KP4, 123, 194, 26, "Cancel" }, | ||
75 | { SDLK_KP6, 257, 195, 34, "Select" }, | ||
76 | { SDLK_KP8, 190, 221, 28, "Up" }, | ||
77 | { SDLK_KP2, 192, 320, 27, "Down" }, | ||
78 | { SDLK_KP_DIVIDE, 349, 49, 20, "Rew" }, | ||
79 | { SDLK_KP5, 349, 96, 20, "Play" }, | ||
80 | { SDLK_KP_MULTIPLY, 350, 141, 23, "FF" }, | ||
81 | #elif defined (IRIVER_H10_5GB) | ||
82 | { SDLK_KP_PLUS, 34, 76, 23, "Power" }, | ||
83 | { SDLK_KP4, 106, 222, 28, "Cancel" }, | ||
84 | { SDLK_KP6, 243, 220, 31, "Select" }, | ||
85 | { SDLK_KP8, 176, 254, 34, "Up" }, | ||
86 | { SDLK_KP2, 175, 371, 35, "Down" }, | ||
87 | { SDLK_KP_DIVIDE, 319, 63, 26, "Rew" }, | ||
88 | { SDLK_KP5, 320, 124, 26, "Play" }, | ||
89 | { SDLK_KP_MULTIPLY, 320, 181, 32, "FF" }, | ||
90 | #endif | ||
91 | { 0, 0, 0, 0, "None" } | ||
92 | }; | ||
diff --git a/uisimulator/buttonmap/iriver-h100_h300.c b/uisimulator/buttonmap/iriver-h100_h300.c new file mode 100644 index 0000000000..5e4ad3bafc --- /dev/null +++ b/uisimulator/buttonmap/iriver-h100_h300.c | |||
@@ -0,0 +1,124 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Dan Everton | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include <SDL.h> | ||
23 | #include "config.h" | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_t: | ||
33 | if(pressed) | ||
34 | switch(_remote_type) | ||
35 | { | ||
36 | case REMOTETYPE_UNPLUGGED: | ||
37 | _remote_type=REMOTETYPE_H100_LCD; | ||
38 | DEBUGF("Changed remote type to H100\n"); | ||
39 | break; | ||
40 | case REMOTETYPE_H100_LCD: | ||
41 | _remote_type=REMOTETYPE_H300_LCD; | ||
42 | DEBUGF("Changed remote type to H300\n"); | ||
43 | break; | ||
44 | case REMOTETYPE_H300_LCD: | ||
45 | _remote_type=REMOTETYPE_H300_NONLCD; | ||
46 | DEBUGF("Changed remote type to H300 NON-LCD\n"); | ||
47 | break; | ||
48 | case REMOTETYPE_H300_NONLCD: | ||
49 | _remote_type=REMOTETYPE_UNPLUGGED; | ||
50 | DEBUGF("Changed remote type to none\n"); | ||
51 | break; | ||
52 | } | ||
53 | break; | ||
54 | case SDLK_KP4: | ||
55 | case SDLK_LEFT: | ||
56 | new_btn = BUTTON_LEFT; | ||
57 | break; | ||
58 | case SDLK_KP6: | ||
59 | case SDLK_RIGHT: | ||
60 | new_btn = BUTTON_RIGHT; | ||
61 | break; | ||
62 | case SDLK_KP8: | ||
63 | case SDLK_UP: | ||
64 | new_btn = BUTTON_UP; | ||
65 | break; | ||
66 | case SDLK_KP2: | ||
67 | case SDLK_DOWN: | ||
68 | new_btn = BUTTON_DOWN; | ||
69 | break; | ||
70 | case SDLK_KP_PLUS: | ||
71 | case SDLK_F8: | ||
72 | new_btn = BUTTON_ON; | ||
73 | break; | ||
74 | case SDLK_KP_ENTER: | ||
75 | case SDLK_RETURN: | ||
76 | case SDLK_a: | ||
77 | new_btn = BUTTON_OFF; | ||
78 | break; | ||
79 | case SDLK_KP_DIVIDE: | ||
80 | case SDLK_F1: | ||
81 | new_btn = BUTTON_REC; | ||
82 | break; | ||
83 | case SDLK_KP5: | ||
84 | case SDLK_SPACE: | ||
85 | new_btn = BUTTON_SELECT; | ||
86 | break; | ||
87 | case SDLK_KP_PERIOD: | ||
88 | case SDLK_INSERT: | ||
89 | new_btn = BUTTON_MODE; | ||
90 | break; | ||
91 | } | ||
92 | return new_btn; | ||
93 | } | ||
94 | |||
95 | struct button_map bm[] = { | ||
96 | #if defined (IRIVER_H120) || defined (IRIVER_H100) | ||
97 | { SDLK_KP_DIVIDE, 46, 162, 13, "Record" }, | ||
98 | { SDLK_KP_PLUS, 327, 36, 16, "Play" }, | ||
99 | { SDLK_KP_ENTER, 330, 99, 18, "Stop" }, | ||
100 | { SDLK_KP_PERIOD, 330, 163, 18, "AB" }, | ||
101 | { SDLK_KP5, 186, 227, 27, "5" }, | ||
102 | { SDLK_KP8, 187, 185, 19, "8" }, | ||
103 | { SDLK_KP4, 142, 229, 23, "4" }, | ||
104 | { SDLK_KP6, 231, 229, 22, "6" }, | ||
105 | { SDLK_KP2, 189, 272, 28, "2" }, | ||
106 | /* Remote Buttons */ | ||
107 | { SDLK_KP_ENTER, 250, 404, 20, "Stop" }, | ||
108 | { SDLK_SPACE, 285, 439, 29, "Space" }, | ||
109 | { SDLK_h, 336, 291, 24, "Hold" }, | ||
110 | #elif defined (IRIVER_H300) | ||
111 | { SDLK_KP_PLUS, 56, 335, 20, "Play" }, | ||
112 | { SDLK_KP8, 140, 304, 29, "Up" }, | ||
113 | { SDLK_KP_DIVIDE, 233, 331, 23, "Record" }, | ||
114 | { SDLK_KP_ENTER, 54, 381, 24, "Stop" }, | ||
115 | { SDLK_KP4, 100, 353, 17, "Left" }, | ||
116 | { SDLK_KP5, 140, 351, 19, "Navi" }, | ||
117 | { SDLK_KP6, 185, 356, 19, "Right" }, | ||
118 | { SDLK_KP_PERIOD, 230, 380, 20, "AB" }, | ||
119 | { SDLK_KP2, 142, 402, 24, "Down" }, | ||
120 | { SDLK_KP_ENTER, 211, 479, 21, "Stop" }, | ||
121 | { SDLK_KP_PLUS, 248, 513, 29, "Play" }, | ||
122 | #endif | ||
123 | { 0, 0, 0, 0, "None" } | ||
124 | }; | ||
diff --git a/uisimulator/buttonmap/iriver-ifp7xx.c b/uisimulator/buttonmap/iriver-ifp7xx.c new file mode 100644 index 0000000000..97f29c7376 --- /dev/null +++ b/uisimulator/buttonmap/iriver-ifp7xx.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Dan Everton | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | case SDLK_KP_PLUS: | ||
49 | case SDLK_F8: | ||
50 | new_btn = BUTTON_PLAY; | ||
51 | break; | ||
52 | case SDLK_KP_ENTER: | ||
53 | case SDLK_RETURN: | ||
54 | case SDLK_a: | ||
55 | new_btn = BUTTON_EQ; | ||
56 | break; | ||
57 | case SDLK_KP5: | ||
58 | case SDLK_SPACE: | ||
59 | new_btn = BUTTON_SELECT; | ||
60 | break; | ||
61 | case SDLK_KP_PERIOD: | ||
62 | case SDLK_INSERT: | ||
63 | new_btn = BUTTON_MODE; | ||
64 | break; | ||
65 | } | ||
66 | return new_btn; | ||
67 | } | ||
68 | |||
69 | struct button_map bm[] = { | ||
70 | { 0, 0, 0, 0, "None" } | ||
71 | }; | ||
diff --git a/uisimulator/buttonmap/meizu-m6sl.c b/uisimulator/buttonmap/meizu-m6sl.c new file mode 100644 index 0000000000..e796dce41d --- /dev/null +++ b/uisimulator/buttonmap/meizu-m6sl.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Marcoen Hirschberg | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP1: | ||
33 | new_btn = BUTTON_PREV; | ||
34 | break; | ||
35 | case SDLK_KP3: | ||
36 | new_btn = BUTTON_NEXT; | ||
37 | break; | ||
38 | case SDLK_KP_ENTER: | ||
39 | case SDLK_RETURN: | ||
40 | case SDLK_a: | ||
41 | new_btn = BUTTON_PLAY; | ||
42 | break; | ||
43 | case SDLK_KP_PERIOD: | ||
44 | case SDLK_INSERT: | ||
45 | new_btn = BUTTON_MENU; | ||
46 | break; | ||
47 | case SDLK_KP8: | ||
48 | case SDLK_UP: | ||
49 | new_btn = BUTTON_UP; | ||
50 | break; | ||
51 | case SDLK_KP2: | ||
52 | case SDLK_DOWN: | ||
53 | new_btn = BUTTON_DOWN; | ||
54 | break; | ||
55 | case SDLK_KP5: | ||
56 | case SDLK_SPACE: | ||
57 | new_btn = BUTTON_SELECT; | ||
58 | break; | ||
59 | } | ||
60 | return new_btn; | ||
61 | } | ||
62 | |||
63 | struct button_map bm[] = { | ||
64 | { 0, 0, 0, 0, "None" } | ||
65 | }; | ||
diff --git a/uisimulator/buttonmap/mpio-hd200.c b/uisimulator/buttonmap/mpio-hd200.c new file mode 100644 index 0000000000..36cbfe5ff1 --- /dev/null +++ b/uisimulator/buttonmap/mpio-hd200.c | |||
@@ -0,0 +1,67 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 Marcin Bukat | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_UP: | ||
33 | new_btn = BUTTON_PREV; | ||
34 | break; | ||
35 | case SDLK_DOWN: | ||
36 | new_btn = BUTTON_NEXT; | ||
37 | break; | ||
38 | case SDLK_SPACE: | ||
39 | new_btn = BUTTON_SELECT; | ||
40 | break; | ||
41 | case SDLK_RETURN: | ||
42 | new_btn = BUTTON_PLAY; | ||
43 | break; | ||
44 | case SDLK_LEFT: | ||
45 | new_btn = BUTTON_VOL_DOWN; | ||
46 | break; | ||
47 | case SDLK_RIGHT: | ||
48 | new_btn = BUTTON_VOL_UP; | ||
49 | break; | ||
50 | case SDLK_ESCAPE: | ||
51 | new_btn = BUTTON_REC; | ||
52 | break; | ||
53 | } | ||
54 | return new_btn; | ||
55 | } | ||
56 | |||
57 | struct button_map bm[] = { | ||
58 | { SDLK_ESCAPE, 369, 257, 20, "Rec" }, | ||
59 | { SDLK_RETURN, 369, 305, 20, "Play/Stop" }, | ||
60 | { SDLK_UP, 353, 168, 10, "Rew" }, | ||
61 | { SDLK_DOWN, 353, 198, 10, "FF" }, | ||
62 | { SDLK_SPACE, 353, 186, 10, "Select" }, | ||
63 | { SDLK_LEFT, 123, 67, 20, "Vol Down" }, | ||
64 | { SDLK_RIGHT, 206, 67, 20, "Vol Up" }, | ||
65 | { SDLK_h, 369, 402, 30, "Hold" }, | ||
66 | { 0, 0, 0, 0, "None" } | ||
67 | }; | ||
diff --git a/uisimulator/buttonmap/mrobe100.c b/uisimulator/buttonmap/mrobe100.c new file mode 100644 index 0000000000..8e96188a93 --- /dev/null +++ b/uisimulator/buttonmap/mrobe100.c | |||
@@ -0,0 +1,105 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Robert Kukla | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_F9: | ||
33 | new_btn = BUTTON_RC_HEART; | ||
34 | break; | ||
35 | case SDLK_F10: | ||
36 | new_btn = BUTTON_RC_MODE; | ||
37 | break; | ||
38 | case SDLK_F11: | ||
39 | new_btn = BUTTON_RC_VOL_DOWN; | ||
40 | break; | ||
41 | case SDLK_F12: | ||
42 | new_btn = BUTTON_RC_VOL_UP; | ||
43 | break; | ||
44 | case SDLK_LEFT: | ||
45 | new_btn = BUTTON_RC_FF; | ||
46 | break; | ||
47 | case SDLK_RIGHT: | ||
48 | new_btn = BUTTON_RC_REW; | ||
49 | break; | ||
50 | case SDLK_UP: | ||
51 | new_btn = BUTTON_RC_PLAY; | ||
52 | break; | ||
53 | case SDLK_DOWN: | ||
54 | new_btn = BUTTON_RC_DOWN; | ||
55 | break; | ||
56 | case SDLK_KP1: | ||
57 | new_btn = BUTTON_DISPLAY; | ||
58 | break; | ||
59 | case SDLK_KP7: | ||
60 | new_btn = BUTTON_MENU; | ||
61 | break; | ||
62 | case SDLK_KP9: | ||
63 | new_btn = BUTTON_PLAY; | ||
64 | break; | ||
65 | case SDLK_KP4: | ||
66 | new_btn = BUTTON_LEFT; | ||
67 | break; | ||
68 | case SDLK_KP6: | ||
69 | new_btn = BUTTON_RIGHT; | ||
70 | break; | ||
71 | case SDLK_KP8: | ||
72 | new_btn = BUTTON_UP; | ||
73 | break; | ||
74 | case SDLK_KP2: | ||
75 | new_btn = BUTTON_DOWN; | ||
76 | break; | ||
77 | case SDLK_KP5: | ||
78 | case SDLK_SPACE: | ||
79 | new_btn = BUTTON_SELECT; | ||
80 | break; | ||
81 | case SDLK_KP_MULTIPLY: | ||
82 | case SDLK_F8: | ||
83 | case SDLK_ESCAPE: | ||
84 | new_btn = BUTTON_POWER; | ||
85 | break; | ||
86 | } | ||
87 | return new_btn; | ||
88 | } | ||
89 | |||
90 | struct button_map bm[] = { | ||
91 | { SDLK_KP7, 80, 233, 30, "Menu" }, | ||
92 | { SDLK_KP8, 138, 250, 19, "Up" }, | ||
93 | { SDLK_KP9, 201, 230, 27, "Play" }, | ||
94 | { SDLK_KP4, 63, 305, 25, "Left" }, | ||
95 | { SDLK_KP5, 125, 309, 28, "Select" }, | ||
96 | { SDLK_KP6, 200, 307, 35, "Right" }, | ||
97 | { SDLK_KP1, 52, 380, 32, "Display" }, | ||
98 | { SDLK_KP2, 125, 363, 30, "Down" }, | ||
99 | { SDLK_KP9, 168, 425, 10, "Play" }, | ||
100 | { SDLK_KP4, 156, 440, 11, "Left" }, | ||
101 | { SDLK_KP6, 180, 440, 13, "Right" }, | ||
102 | { SDLK_KP7, 169, 452, 10, "Menu" }, | ||
103 | { SDLK_KP_MULTIPLY, 222, 15, 16, "Power" }, | ||
104 | { 0, 0, 0, 0, "None" } | ||
105 | }; | ||
diff --git a/uisimulator/buttonmap/mrobe500.c b/uisimulator/buttonmap/mrobe500.c new file mode 100644 index 0000000000..50d85f6901 --- /dev/null +++ b/uisimulator/buttonmap/mrobe500.c | |||
@@ -0,0 +1,76 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 Karl Kurbjun | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_F9: | ||
33 | new_btn = BUTTON_RC_HEART; | ||
34 | break; | ||
35 | case SDLK_F10: | ||
36 | new_btn = BUTTON_RC_MODE; | ||
37 | break; | ||
38 | case SDLK_F11: | ||
39 | new_btn = BUTTON_RC_VOL_DOWN; | ||
40 | break; | ||
41 | case SDLK_F12: | ||
42 | new_btn = BUTTON_RC_VOL_UP; | ||
43 | break; | ||
44 | case SDLK_MINUS: | ||
45 | case SDLK_LESS: | ||
46 | case SDLK_LEFTBRACKET: | ||
47 | case SDLK_KP_DIVIDE: | ||
48 | new_btn = BUTTON_LEFT; | ||
49 | break; | ||
50 | case SDLK_PLUS: | ||
51 | case SDLK_GREATER: | ||
52 | case SDLK_RIGHTBRACKET: | ||
53 | case SDLK_KP_MULTIPLY: | ||
54 | new_btn = BUTTON_RIGHT; | ||
55 | break; | ||
56 | case SDLK_PAGEUP: | ||
57 | new_btn = BUTTON_RC_PLAY; | ||
58 | break; | ||
59 | case SDLK_PAGEDOWN: | ||
60 | new_btn = BUTTON_RC_DOWN; | ||
61 | break; | ||
62 | case SDLK_F8: | ||
63 | case SDLK_ESCAPE: | ||
64 | new_btn = BUTTON_POWER; | ||
65 | break; | ||
66 | } | ||
67 | return new_btn; | ||
68 | } | ||
69 | |||
70 | struct button_map bm[] = { | ||
71 | { SDLK_KP9, 171, 609, 9, "Play" }, | ||
72 | { SDLK_KP4, 158, 623, 9, "Left" }, | ||
73 | { SDLK_KP6, 184, 622, 9, "Right" }, | ||
74 | { SDLK_KP7, 171, 638, 11, "Menu" }, | ||
75 | { 0, 0, 0, 0, "None" } | ||
76 | }; | ||
diff --git a/uisimulator/buttonmap/onda-vx747.c b/uisimulator/buttonmap/onda-vx747.c new file mode 100644 index 0000000000..6d50427075 --- /dev/null +++ b/uisimulator/buttonmap/onda-vx747.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Maurus Cuelenaere | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_ESCAPE: | ||
33 | new_btn = BUTTON_POWER; | ||
34 | break; | ||
35 | case SDLK_KP_PLUS: | ||
36 | case SDLK_PLUS: | ||
37 | case SDLK_GREATER: | ||
38 | case SDLK_RIGHTBRACKET: | ||
39 | case SDLK_KP_MULTIPLY: | ||
40 | new_btn = BUTTON_VOL_UP; | ||
41 | break; | ||
42 | case SDLK_KP_MINUS: | ||
43 | case SDLK_MINUS: | ||
44 | case SDLK_LESS: | ||
45 | case SDLK_LEFTBRACKET: | ||
46 | case SDLK_KP_DIVIDE: | ||
47 | new_btn = BUTTON_VOL_DOWN; | ||
48 | break; | ||
49 | case SDLK_KP_ENTER: | ||
50 | case SDLK_RETURN: | ||
51 | new_btn = BUTTON_MENU; | ||
52 | break; | ||
53 | } | ||
54 | return new_btn; | ||
55 | } | ||
56 | |||
57 | struct button_map bm[] = { | ||
58 | { SDLK_MINUS, 113, 583, 28, "Minus" }, | ||
59 | { SDLK_PLUS, 227, 580, 28, "Plus" }, | ||
60 | { SDLK_RETURN, 171, 583, 34, "Menu" }, | ||
61 | { 0, 0, 0, 0, "None" } | ||
62 | }; | ||
diff --git a/uisimulator/buttonmap/onda-vx777.c b/uisimulator/buttonmap/onda-vx777.c new file mode 100644 index 0000000000..9181b07fe0 --- /dev/null +++ b/uisimulator/buttonmap/onda-vx777.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Maurus Cuelenaere | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_ESCAPE: | ||
33 | new_btn = BUTTON_POWER; | ||
34 | break; | ||
35 | } | ||
36 | return new_btn; | ||
37 | } | ||
38 | |||
39 | struct button_map bm[] = { | ||
40 | { 0, 0, 0, 0, "None" } | ||
41 | }; | ||
diff --git a/uisimulator/buttonmap/pbell-vibe500.c b/uisimulator/buttonmap/pbell-vibe500.c new file mode 100644 index 0000000000..662d2248bf --- /dev/null +++ b/uisimulator/buttonmap/pbell-vibe500.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 Szymon Dziok | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_PREV; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_NEXT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | case SDLK_KP7: | ||
49 | new_btn = BUTTON_MENU; | ||
50 | break; | ||
51 | case SDLK_KP9: | ||
52 | new_btn = BUTTON_PLAY; | ||
53 | break; | ||
54 | case SDLK_KP5: | ||
55 | new_btn = BUTTON_OK; | ||
56 | break; | ||
57 | case SDLK_KP_DIVIDE: | ||
58 | new_btn = BUTTON_CANCEL; | ||
59 | break; | ||
60 | case SDLK_KP_PLUS: | ||
61 | new_btn = BUTTON_POWER; | ||
62 | break; | ||
63 | case SDLK_KP_MULTIPLY: | ||
64 | new_btn = BUTTON_REC; | ||
65 | break; | ||
66 | } | ||
67 | return new_btn; | ||
68 | } | ||
69 | |||
70 | struct button_map bm[] = { | ||
71 | { 0, 0, 0, 0, "None" } | ||
72 | }; | ||
diff --git a/uisimulator/buttonmap/samsung-yh820_yh92x.c b/uisimulator/buttonmap/samsung-yh820_yh92x.c new file mode 100644 index 0000000000..0f12c77df3 --- /dev/null +++ b/uisimulator/buttonmap/samsung-yh820_yh92x.c | |||
@@ -0,0 +1,94 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Mark Arigo | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "config.h" | ||
25 | #include "button.h" | ||
26 | #include "buttonmap.h" | ||
27 | |||
28 | int key_to_button(int keyboard_button) | ||
29 | { | ||
30 | int new_btn = BUTTON_NONE; | ||
31 | switch (keyboard_button) | ||
32 | { | ||
33 | case SDLK_KP4: | ||
34 | case SDLK_LEFT: | ||
35 | new_btn = BUTTON_LEFT; | ||
36 | break; | ||
37 | case SDLK_KP6: | ||
38 | case SDLK_RIGHT: | ||
39 | new_btn = BUTTON_RIGHT; | ||
40 | break; | ||
41 | case SDLK_KP8: | ||
42 | case SDLK_UP: | ||
43 | new_btn = BUTTON_UP; | ||
44 | break; | ||
45 | case SDLK_KP2: | ||
46 | case SDLK_DOWN: | ||
47 | new_btn = BUTTON_DOWN; | ||
48 | break; | ||
49 | case SDLK_KP5: | ||
50 | case SDLK_KP_ENTER: | ||
51 | new_btn = BUTTON_PLAY; | ||
52 | break; | ||
53 | case SDLK_KP9: | ||
54 | case SDLK_PAGEUP: | ||
55 | new_btn = BUTTON_FFWD; | ||
56 | break; | ||
57 | #ifdef SAMSUNG_YH820 | ||
58 | case SDLK_KP7: | ||
59 | #else | ||
60 | case SDLK_KP3: | ||
61 | #endif | ||
62 | case SDLK_PAGEDOWN: | ||
63 | new_btn = BUTTON_REW; | ||
64 | break; | ||
65 | case SDLK_KP_PLUS: | ||
66 | new_btn = BUTTON_REC; | ||
67 | break; | ||
68 | } | ||
69 | return new_btn; | ||
70 | } | ||
71 | |||
72 | struct button_map bm[] = { | ||
73 | #if defined (SAMSUNG_YH820) | ||
74 | { SDLK_KP_PLUS, 330, 53, 23, "Record" }, | ||
75 | { SDLK_KP7, 132, 208, 21, "Left" }, | ||
76 | { SDLK_KP5, 182, 210, 18, "Play" }, | ||
77 | { SDLK_KP9, 234, 211, 22, "Right" }, | ||
78 | { SDLK_KP8, 182, 260, 15, "Up" }, | ||
79 | { SDLK_KP4, 122, 277, 29, "Menu" }, | ||
80 | { SDLK_KP6, 238, 276, 25, "Select" }, | ||
81 | { SDLK_KP2, 183, 321, 24, "Down" }, | ||
82 | #elif defined (SAMSUNG_YH920) || defined (SAMSUNG_YH925) | ||
83 | { SDLK_KP9, 370, 32, 15, "FF" }, | ||
84 | { SDLK_KP5, 369, 84, 25, "Play" }, | ||
85 | { SDLK_KP5, 367, 125, 27, "Play" }, | ||
86 | { SDLK_KP3, 369, 188, 17, "Rew" }, | ||
87 | { SDLK_KP_PLUS, 370, 330, 30, "Record" }, | ||
88 | { SDLK_KP4, 146, 252, 32, "Menu" }, | ||
89 | { SDLK_KP8, 204, 226, 27, "Up" }, | ||
90 | { SDLK_KP6, 257, 250, 34, "Select" }, | ||
91 | { SDLK_KP2, 205, 294, 35, "Down" }, | ||
92 | #endif | ||
93 | { 0, 0, 0, 0, "None" } | ||
94 | }; | ||
diff --git a/uisimulator/buttonmap/sansa-c200.c b/uisimulator/buttonmap/sansa-c200.c new file mode 100644 index 0000000000..96755d0185 --- /dev/null +++ b/uisimulator/buttonmap/sansa-c200.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 Mark Arigo | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | case SDLK_KP3: | ||
49 | new_btn = BUTTON_POWER; | ||
50 | break; | ||
51 | case SDLK_KP1: | ||
52 | new_btn = BUTTON_REC; | ||
53 | break; | ||
54 | case SDLK_KP5: | ||
55 | case SDLK_KP_ENTER: | ||
56 | case SDLK_RETURN: | ||
57 | new_btn = BUTTON_SELECT; | ||
58 | break; | ||
59 | case SDLK_KP7: | ||
60 | new_btn = BUTTON_VOL_DOWN; | ||
61 | break; | ||
62 | case SDLK_KP9: | ||
63 | new_btn = BUTTON_VOL_UP; | ||
64 | break; | ||
65 | } | ||
66 | return new_btn; | ||
67 | } | ||
68 | |||
69 | struct button_map bm[] = { | ||
70 | |||
71 | { SDLK_KP7, 84, 7, 21, "Vol Down" }, | ||
72 | { SDLK_KP9, 158, 7, 20, "Vol Up" }, | ||
73 | { SDLK_KP1, 173, 130, 27, "Record" }, | ||
74 | { SDLK_KP5, 277, 75, 21, "Select" }, | ||
75 | { SDLK_KP4, 233, 75, 24, "Left" }, | ||
76 | { SDLK_KP6, 313, 74, 18, "Right" }, | ||
77 | { SDLK_KP8, 276, 34, 15, "Play" }, | ||
78 | { SDLK_KP2, 277, 119, 17, "Down" }, | ||
79 | { SDLK_KP3, 314, 113, 19, "Menu" }, | ||
80 | { 0, 0, 0, 0, "None" } | ||
81 | }; | ||
diff --git a/uisimulator/buttonmap/sansa-clip.c b/uisimulator/buttonmap/sansa-clip.c new file mode 100644 index 0000000000..c1997ade6d --- /dev/null +++ b/uisimulator/buttonmap/sansa-clip.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Rafaël Carré | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | |||
49 | case SDLK_INSERT: | ||
50 | case SDLK_KP_MULTIPLY: | ||
51 | new_btn = BUTTON_HOME; | ||
52 | break; | ||
53 | case SDLK_SPACE: | ||
54 | case SDLK_KP5: | ||
55 | new_btn = BUTTON_SELECT; | ||
56 | break; | ||
57 | case SDLK_PAGEDOWN: | ||
58 | case SDLK_KP3: | ||
59 | new_btn = BUTTON_VOL_DOWN; | ||
60 | break; | ||
61 | case SDLK_PAGEUP: | ||
62 | case SDLK_KP9: | ||
63 | new_btn = BUTTON_VOL_UP; | ||
64 | break; | ||
65 | case SDLK_ESCAPE: | ||
66 | case SDLK_KP1: | ||
67 | new_btn = BUTTON_POWER; | ||
68 | break; | ||
69 | } | ||
70 | return new_btn; | ||
71 | } | ||
72 | |||
73 | struct button_map bm[] = { | ||
74 | { SDLK_KP_MULTIPLY, 165, 158, 17, "Home" }, | ||
75 | { SDLK_KP5, 102, 230, 29, "Select" }, | ||
76 | { SDLK_KP8, 100, 179, 25, "Play" }, | ||
77 | { SDLK_KP4, 53, 231, 21, "Left" }, | ||
78 | { SDLK_KP6, 147, 232, 19, "Right" }, | ||
79 | { SDLK_KP2, 105, 275, 22, "Menu" }, | ||
80 | { 0, 0, 0, 0, "None" } | ||
81 | }; | ||
diff --git a/uisimulator/buttonmap/sansa-e200.c b/uisimulator/buttonmap/sansa-e200.c new file mode 100644 index 0000000000..66655e26c5 --- /dev/null +++ b/uisimulator/buttonmap/sansa-e200.c | |||
@@ -0,0 +1,83 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Barry Wardell | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_SCROLL_BACK; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_SCROLL_FWD; | ||
47 | break; | ||
48 | case SDLK_KP9: | ||
49 | case SDLK_PAGEUP: | ||
50 | new_btn = BUTTON_UP; | ||
51 | break; | ||
52 | case SDLK_KP3: | ||
53 | case SDLK_PAGEDOWN: | ||
54 | new_btn = BUTTON_DOWN; | ||
55 | break; | ||
56 | case SDLK_KP1: | ||
57 | case SDLK_HOME: | ||
58 | new_btn = BUTTON_POWER; | ||
59 | break; | ||
60 | case SDLK_KP7: | ||
61 | case SDLK_END: | ||
62 | new_btn = BUTTON_REC; | ||
63 | break; | ||
64 | case SDLK_KP5: | ||
65 | case SDLK_SPACE: | ||
66 | new_btn = BUTTON_SELECT; | ||
67 | break; | ||
68 | } | ||
69 | return new_btn; | ||
70 | } | ||
71 | |||
72 | struct button_map bm[] = { | ||
73 | { SDLK_KP7, 5, 92, 18, "Record" }, | ||
74 | { SDLK_KP9, 128, 295, 43, "Play" }, | ||
75 | { SDLK_KP4, 42, 380, 33, "Left" }, | ||
76 | { SDLK_KP5, 129, 378, 36, "Select" }, | ||
77 | { SDLK_KP6, 218, 383, 30, "Right" }, | ||
78 | { SDLK_KP3, 129, 461, 29, "Down" }, | ||
79 | { SDLK_KP1, 55, 464, 20, "Menu" }, | ||
80 | { SDLK_KP8, 92, 338, 17, "Scroll Back" }, | ||
81 | { SDLK_KP2, 167, 342, 17, "Scroll Fwd" }, | ||
82 | { 0, 0, 0, 0, "None" } | ||
83 | }; | ||
diff --git a/uisimulator/buttonmap/sansa-fuze.c b/uisimulator/buttonmap/sansa-fuze.c new file mode 100644 index 0000000000..2788af5d51 --- /dev/null +++ b/uisimulator/buttonmap/sansa-fuze.c | |||
@@ -0,0 +1,85 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Thomas Martitz | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_SCROLL_BACK; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_SCROLL_FWD; | ||
47 | break; | ||
48 | case SDLK_PAGEUP: | ||
49 | case SDLK_KP9: | ||
50 | new_btn = BUTTON_UP; | ||
51 | break; | ||
52 | case SDLK_PAGEDOWN: | ||
53 | case SDLK_KP3: | ||
54 | new_btn = BUTTON_DOWN; | ||
55 | break; | ||
56 | case SDLK_KP_MINUS: | ||
57 | case SDLK_KP1: | ||
58 | new_btn = BUTTON_POWER; | ||
59 | break; | ||
60 | case SDLK_KP_MULTIPLY: | ||
61 | new_btn = BUTTON_HOME; | ||
62 | break; | ||
63 | case SDLK_KP5: | ||
64 | case SDLK_SPACE: | ||
65 | case SDLK_KP_ENTER: | ||
66 | case SDLK_RETURN: | ||
67 | new_btn = BUTTON_SELECT; | ||
68 | break; | ||
69 | } | ||
70 | return new_btn; | ||
71 | } | ||
72 | |||
73 | struct button_map bm[] = { | ||
74 | { SDLK_KP8, 70, 265, 35, "Scroll Back" }, | ||
75 | { SDLK_KP9, 141, 255, 31, "Play" }, | ||
76 | { SDLK_KP_MULTIPLY, 228, 267, 18, "Home" }, | ||
77 | { SDLK_LEFT, 69, 329, 31, "Left" }, | ||
78 | { SDLK_SPACE, 141, 330, 20, "Select" }, | ||
79 | { SDLK_RIGHT, 214, 331, 23, "Right" }, | ||
80 | { SDLK_KP3, 142, 406, 30, "Menu" }, | ||
81 | { SDLK_DOWN, 221, 384, 24, "Scroll Fwd" }, | ||
82 | { SDLK_KP_MINUS, 270, 299, 25, "Power" }, | ||
83 | { SDLK_h, 269, 358, 26, "Hold" }, | ||
84 | { 0, 0, 0, 0, "None" } | ||
85 | }; | ||
diff --git a/uisimulator/buttonmap/sansa-m200.c b/uisimulator/buttonmap/sansa-m200.c new file mode 100644 index 0000000000..6a8c4f2f8f --- /dev/null +++ b/uisimulator/buttonmap/sansa-m200.c | |||
@@ -0,0 +1,75 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Dominik Wenger | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <SDL.h> | ||
24 | #include "button.h" | ||
25 | #include "buttonmap.h" | ||
26 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | case SDLK_KP4: | ||
33 | case SDLK_LEFT: | ||
34 | new_btn = BUTTON_LEFT; | ||
35 | break; | ||
36 | case SDLK_KP6: | ||
37 | case SDLK_RIGHT: | ||
38 | new_btn = BUTTON_RIGHT; | ||
39 | break; | ||
40 | case SDLK_KP8: | ||
41 | case SDLK_UP: | ||
42 | new_btn = BUTTON_UP; | ||
43 | break; | ||
44 | case SDLK_KP2: | ||
45 | case SDLK_DOWN: | ||
46 | new_btn = BUTTON_DOWN; | ||
47 | break; | ||
48 | case SDLK_PLUS: | ||
49 | new_btn = BUTTON_POWER; | ||
50 | break; | ||
51 | case SDLK_KP5: | ||
52 | new_btn = BUTTON_SELECT; | ||
53 | break; | ||
54 | case SDLK_KP7: | ||
55 | new_btn = BUTTON_VOL_DOWN; | ||
56 | break; | ||
57 | case SDLK_KP9: | ||
58 | new_btn = BUTTON_VOL_UP; | ||
59 | break; | ||
60 | } | ||
61 | return new_btn; | ||
62 | } | ||
63 | |||
64 | struct button_map bm[] = { | ||
65 | { SDLK_KP_PLUS, 54, 14, 16, "Power" }, | ||
66 | { SDLK_KP7, 96, 13, 12, "Vol Down" }, | ||
67 | { SDLK_KP9, 139, 14, 14, "Vol Up" }, | ||
68 | { SDLK_KP5, 260, 82, 20, "Select" }, | ||
69 | { SDLK_KP8, 258, 35, 30, "Play" }, | ||
70 | { SDLK_KP4, 214, 84, 25, "Left" }, | ||
71 | { SDLK_KP6, 300, 83, 24, "Right" }, | ||
72 | { SDLK_KP2, 262, 125, 28, "Repeat" }, | ||
73 | { SDLK_h, 113, 151, 21, "Hold" }, | ||
74 | { 0, 0, 0, 0, "None" } | ||
75 | }; | ||
diff --git a/uisimulator/buttonmap/touchscreen.c b/uisimulator/buttonmap/touchscreen.c new file mode 100644 index 0000000000..746a6d5f20 --- /dev/null +++ b/uisimulator/buttonmap/touchscreen.c | |||
@@ -0,0 +1,103 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Jonathan Gordon | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <stdio.h> | ||
24 | #include <SDL.h> | ||
25 | #include "button.h" | ||
26 | #include "buttonmap.h" | ||
27 | #include "touchscreen.h" | ||
28 | |||
29 | int key_to_touch(int keyboard_button) | ||
30 | { | ||
31 | int new_btn = BUTTON_NONE; | ||
32 | switch (keyboard_button) | ||
33 | { | ||
34 | case BUTTON_TOUCHSCREEN: | ||
35 | switch (touchscreen_get_mode()) | ||
36 | { | ||
37 | case TOUCHSCREEN_POINT: | ||
38 | new_btn = BUTTON_TOUCHSCREEN; | ||
39 | break; | ||
40 | case TOUCHSCREEN_BUTTON: | ||
41 | { | ||
42 | static const int touchscreen_buttons[3][3] = { | ||
43 | {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT}, | ||
44 | {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT}, | ||
45 | {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT}, | ||
46 | }; | ||
47 | int px_x = ((mouse_coords&0xffff0000)>>16); | ||
48 | int px_y = ((mouse_coords&0x0000ffff)); | ||
49 | new_btn = touchscreen_buttons[px_y/(LCD_HEIGHT/3)][px_x/(LCD_WIDTH/3)]; | ||
50 | break; | ||
51 | } | ||
52 | } | ||
53 | break; | ||
54 | case SDLK_KP7: | ||
55 | case SDLK_7: | ||
56 | new_btn = BUTTON_TOPLEFT; | ||
57 | break; | ||
58 | case SDLK_KP8: | ||
59 | case SDLK_8: | ||
60 | case SDLK_UP: | ||
61 | new_btn = BUTTON_TOPMIDDLE; | ||
62 | break; | ||
63 | case SDLK_KP9: | ||
64 | case SDLK_9: | ||
65 | new_btn = BUTTON_TOPRIGHT; | ||
66 | break; | ||
67 | case SDLK_KP4: | ||
68 | case SDLK_u: | ||
69 | case SDLK_LEFT: | ||
70 | new_btn = BUTTON_MIDLEFT; | ||
71 | break; | ||
72 | case SDLK_KP5: | ||
73 | case SDLK_i: | ||
74 | new_btn = BUTTON_CENTER; | ||
75 | break; | ||
76 | case SDLK_KP6: | ||
77 | case SDLK_o: | ||
78 | case SDLK_RIGHT: | ||
79 | new_btn = BUTTON_MIDRIGHT; | ||
80 | break; | ||
81 | case SDLK_KP1: | ||
82 | case SDLK_j: | ||
83 | new_btn = BUTTON_BOTTOMLEFT; | ||
84 | break; | ||
85 | case SDLK_KP2: | ||
86 | case SDLK_k: | ||
87 | case SDLK_DOWN: | ||
88 | new_btn = BUTTON_BOTTOMMIDDLE; | ||
89 | break; | ||
90 | case SDLK_KP3: | ||
91 | case SDLK_l: | ||
92 | new_btn = BUTTON_BOTTOMRIGHT; | ||
93 | break; | ||
94 | case SDLK_F4: | ||
95 | if(pressed) | ||
96 | { | ||
97 | touchscreen_set_mode(touchscreen_get_mode() == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); | ||
98 | printf("Touchscreen mode: %s\n", touchscreen_get_mode() == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); | ||
99 | } | ||
100 | break; | ||
101 | } | ||
102 | return new_btn; | ||
103 | } | ||
diff --git a/uisimulator/uisimulator.make b/uisimulator/uisimulator.make index 2e6e75fdfe..d09fcc2063 100644 --- a/uisimulator/uisimulator.make +++ b/uisimulator/uisimulator.make | |||
@@ -7,12 +7,13 @@ | |||
7 | # $Id$ | 7 | # $Id$ |
8 | # | 8 | # |
9 | 9 | ||
10 | INCLUDES += -I$(ROOTDIR)/uisimulator/bitmaps -I$(ROOTDIR)/uisimulator/common \ | 10 | INCLUDES += -I$(ROOTDIR)/uisimulator/bitmaps -I$(ROOTDIR)/uisimulator/common -I$(ROOTDIR)/uisimulator/buttonmap $\ |
11 | -I$(FIRMDIR)/include -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR) | 11 | -I$(FIRMDIR)/include -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR) |
12 | 12 | ||
13 | SIMFLAGS += $(INCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS) | 13 | SIMFLAGS += $(INCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS) |
14 | 14 | ||
15 | SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/common/SOURCES) | 15 | SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/common/SOURCES) |
16 | SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/buttonmap/SOURCES) | ||
16 | SIMOBJ = $(call c2obj,$(SIMSRC)) | 17 | SIMOBJ = $(call c2obj,$(SIMSRC)) |
17 | OTHER_SRC += $(SIMSRC) | 18 | OTHER_SRC += $(SIMSRC) |
18 | 19 | ||