summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/buttonmap/SOURCES68
-rw-r--r--uisimulator/buttonmap/archos-av300.c81
-rw-r--r--uisimulator/buttonmap/archos-ondio.c69
-rw-r--r--uisimulator/buttonmap/archos-player.c68
-rw-r--r--uisimulator/buttonmap/archos-recorder.c104
-rw-r--r--uisimulator/buttonmap/buttonmap.h42
-rw-r--r--uisimulator/buttonmap/buttonmaps.c40
-rw-r--r--uisimulator/buttonmap/cowon-d2.c64
-rw-r--r--uisimulator/buttonmap/creative-zv.c92
-rw-r--r--uisimulator/buttonmap/creative-zvm.c83
-rw-r--r--uisimulator/buttonmap/gigabeat-s.c79
-rw-r--r--uisimulator/buttonmap/gigabeat.c90
-rw-r--r--uisimulator/buttonmap/gogear-hdd1630.c77
-rw-r--r--uisimulator/buttonmap/gogear-sa9200.c88
-rw-r--r--uisimulator/buttonmap/iaudio-6_7.c64
-rw-r--r--uisimulator/buttonmap/iaudio-x5_m5.c96
-rw-r--r--uisimulator/buttonmap/iaudo-m3.c101
-rw-r--r--uisimulator/buttonmap/ipod.c136
-rw-r--r--uisimulator/buttonmap/iriver-h10.c92
-rw-r--r--uisimulator/buttonmap/iriver-h100_h300.c124
-rw-r--r--uisimulator/buttonmap/iriver-ifp7xx.c71
-rw-r--r--uisimulator/buttonmap/meizu-m6sl.c65
-rw-r--r--uisimulator/buttonmap/mpio-hd200.c67
-rw-r--r--uisimulator/buttonmap/mrobe100.c105
-rw-r--r--uisimulator/buttonmap/mrobe500.c76
-rw-r--r--uisimulator/buttonmap/onda-vx747.c62
-rw-r--r--uisimulator/buttonmap/onda-vx777.c41
-rw-r--r--uisimulator/buttonmap/pbell-vibe500.c72
-rw-r--r--uisimulator/buttonmap/samsung-yh820_yh92x.c94
-rw-r--r--uisimulator/buttonmap/sansa-c200.c81
-rw-r--r--uisimulator/buttonmap/sansa-clip.c81
-rw-r--r--uisimulator/buttonmap/sansa-e200.c83
-rw-r--r--uisimulator/buttonmap/sansa-fuze.c85
-rw-r--r--uisimulator/buttonmap/sansa-m200.c75
-rw-r--r--uisimulator/buttonmap/touchscreen.c103
-rw-r--r--uisimulator/uisimulator.make3
36 files changed, 2821 insertions, 1 deletions
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
2buttonmaps.c
3#ifdef HAVE_TOUCHSCREEN
4touchscreen.c
5#endif
6#if CONFIG_KEYPAD == GIGABEAT_PAD
7gigabeat.c
8#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
9gigabeat-s.c
10#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
11iaudio-x5m5.c
12#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
13iaudio-m3.c
14#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) \
15 || (CONFIG_KEYPAD == IPOD_4G_PAD)
16ipod.c
17#elif CONFIG_KEYPAD == IRIVER_H10_PAD
18iriver-h10.c
19#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
20iriver-h100_h300.c
21#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
22iriver-ifp7xx.c
23#elif CONFIG_KEYPAD == ONDIO_PAD
24archos-ondio.c
25#elif CONFIG_KEYPAD == PLAYER_PAD
26archos-player.c
27#elif CONFIG_KEYPAD == RECORDER_PAD
28archos-recorder.c
29#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
30archos-av300.c
31#elif CONFIG_KEYPAD == SANSA_C200_PAD
32sansa-c200.c
33#elif CONFIG_KEYPAD == SANSA_CLIP_PAD
34sansa-clip.c
35#elif CONFIG_KEYPAD == SANSA_E200_PAD
36sansa-e200.c
37#elif CONFIG_KEYPAD == SANSA_FUZE_PAD
38sansa-fuze.c
39#elif CONFIG_KEYPAD == SANSA_M200_PAD
40sansa-m200.c
41#elif CONFIG_KEYPAD == MROBE500_PAD
42mrobe500.c
43#elif CONFIG_KEYPAD == MROBE100_PAD
44mrobe100.c
45#elif CONFIG_KEYPAD == COWON_D2_PAD
46cowon-d2.c
47#elif CONFIG_KEYPAD == IAUDIO67_PAD
48iaudio-6_7.c
49#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
50creative-zvm.c
51#elif CONFIG_KEYPAD == MEIZU_M6SL_PAD
52meizu-m6sl.c
53#elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD
54gogear-sa9200.c
55#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD
56gogear-hdd1630.c
57#elif CONFIG_KEYPAD == ONDAVX747_PAD
58onda-vx747.c
59#elif CONFIG_KEYPAD == ONDAVX777_PAD
60onda-vx777.c
61#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD
62samsung-yh820_yh925.c
63#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD
64pbell-vibe500.c
65#elif CONFIG_KEYPAD == MPIO_HD200_PAD
66mpio-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
27int 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
78struct 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
27int 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
61struct 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
27int 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
60struct 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
28int 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
78struct 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 */
28struct button_map {
29 int button, x, y, radius;
30 char *description;
31};
32
33extern struct button_map bm[];
34
35int xy2button( int x, int y);
36
37int key_to_button(int keyboard_button);
38#ifdef HAVE_TOUCHSCREEN
39int 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
27int 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
27int 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
57struct 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
27int 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
82struct 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
27int 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
73struct 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 @@
1n/***************************************************************************
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
23int 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
69struct 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 @@
1n/***************************************************************************
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
27int 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
78struct 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
27int 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
75struct 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
27int 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
75struct 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
27int 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
62struct 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
28int 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
73struct 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
27int 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
82struct 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
28int 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
65struct 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
27int 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
71struct 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
27int 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
95struct 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
27int 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
69struct 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
27int 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
63struct 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
27int 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
57struct 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
27int 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
90struct 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
27int 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
70struct 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
27int 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
57struct 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
27int 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
39struct 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
27int 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
70struct 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
28int 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
72struct 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
27int 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
69struct 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
27int 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
73struct 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
27int 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
72struct 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
27int 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
73struct 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
27int 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
64struct 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
29int 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
10INCLUDES += -I$(ROOTDIR)/uisimulator/bitmaps -I$(ROOTDIR)/uisimulator/common \ 10INCLUDES += -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
13SIMFLAGS += $(INCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS) 13SIMFLAGS += $(INCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS)
14 14
15SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/common/SOURCES) 15SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/common/SOURCES)
16SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/buttonmap/SOURCES)
16SIMOBJ = $(call c2obj,$(SIMSRC)) 17SIMOBJ = $(call c2obj,$(SIMSRC))
17OTHER_SRC += $(SIMSRC) 18OTHER_SRC += $(SIMSRC)
18 19