1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
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 ****************************************************************************/
24 #include "buttonmap.h"
26 int key_to_button(int keyboard_button
)
28 int new_btn
= BUTTON_NONE
;
29 switch (keyboard_button
)
33 new_btn
= BUTTON_LEFT
;
37 new_btn
= BUTTON_RIGHT
;
45 new_btn
= BUTTON_DOWN
;
49 new_btn
= BUTTON_POWER
;
52 new_btn
= BUTTON_POWER
;
61 new_btn
= BUTTON_SELECT
;
65 new_btn
= BUTTON_MENU
;
68 new_btn
= BUTTON_VOL_UP
;
71 new_btn
= BUTTON_VOL_DOWN
;
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" }