1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2010 Michael Leslie
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 ****************************************************************************/
25 #include "buttonmap.h"
27 int key_to_button(int keyboard_button
)
29 int new_btn
= BUTTON_NONE
;
30 switch (keyboard_button
)
37 new_btn
= BUTTON_DOWN
;
41 new_btn
= BUTTON_LEFT
;
44 new_btn
= BUTTON_RIGHT
;
49 new_btn
= BUTTON_MENU
;
53 new_btn
= BUTTON_ENTER
;
57 new_btn
= BUTTON_PLAY
;
67 struct button_map bm
[] = {
68 { SDLK_LEFT
, 98, 312, 15, "Rew" },
69 { SDLK_RIGHT
, 186, 312, 15, "FF" },
71 { SDLK_ESCAPE
, 90, 364, 40, "Menu" },
72 { SDLK_RETURN
, 196, 364, 40, "Enter" },
74 { SDLK_r
, 98, 410, 15, "Rec" },
75 { SDLK_p
, 186, 410, 15, "Play/Stop" },
77 { SDLK_UP
, 143, 315, 40, "Up" },
78 { SDLK_DOWN
, 143, 415, 40, "Down" },
80 { SDLK_h
, 116, 52, 20, "Hold" },
81 { 0, 0, 0, 0, "None" }