forgot comment
[kugel-rb.git] / uisimulator / buttonmap / gigabeat.c
blob540b9f6ce89c7c449da48f80cd0d7beed818e1db
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 by Barry Wardell
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include <SDL.h>
23 #include "button.h"
24 #include "buttonmap.h"
26 int key_to_button(int keyboard_button)
28 int new_btn = BUTTON_NONE;
29 switch (keyboard_button)
31 case SDLK_KP4:
32 case SDLK_LEFT:
33 new_btn = BUTTON_LEFT;
34 break;
35 case SDLK_KP6:
36 case SDLK_RIGHT:
37 new_btn = BUTTON_RIGHT;
38 break;
39 case SDLK_KP8:
40 case SDLK_UP:
41 new_btn = BUTTON_UP;
42 break;
43 case SDLK_KP2:
44 case SDLK_DOWN:
45 new_btn = BUTTON_DOWN;
46 break;
47 case SDLK_KP_PLUS:
48 case SDLK_F8:
49 new_btn = BUTTON_POWER;
50 break;
51 case SDLK_ESCAPE:
52 new_btn = BUTTON_POWER;
53 break;
54 case SDLK_KP_ENTER:
55 case SDLK_RETURN:
56 case SDLK_a:
57 new_btn = BUTTON_A;
58 break;
59 case SDLK_KP5:
60 case SDLK_SPACE:
61 new_btn = BUTTON_SELECT;
62 break;
63 case SDLK_KP_PERIOD:
64 case SDLK_INSERT:
65 new_btn = BUTTON_MENU;
66 break;
67 case SDLK_KP9:
68 new_btn = BUTTON_VOL_UP;
69 break;
70 case SDLK_KP3:
71 new_btn = BUTTON_VOL_DOWN;
72 break;
74 return new_btn;
77 struct button_map bm[] = {
78 { SDLK_KP_PLUS, 361, 187, 22, "Power" },
79 { SDLK_KP_PERIOD, 361, 270, 17, "Menu" },
80 { SDLK_KP9, 365, 345, 26, "Vol Up" },
81 { SDLK_KP3, 363, 433, 25, "Vol Down" },
82 { SDLK_KP_ENTER, 365, 520, 19, "A" },
83 { SDLK_KP8, 167, 458, 35, "Up" },
84 { SDLK_KP4, 86, 537, 29, "Left" },
85 { SDLK_KP5, 166, 536, 30, "Select" },
86 { SDLK_KP6, 248, 536, 30, "Right" },
87 { SDLK_KP2, 169, 617, 28, "Down" },
88 { 0, 0, 0, 0, "None" }