1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2008 by Jens Arnold
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
)
33 new_btn
= BUTTON_LEFT
;
36 new_btn
= BUTTON_RC_REW
;
39 new_btn
= BUTTON_RIGHT
;
42 new_btn
= BUTTON_RC_FF
;
45 new_btn
= BUTTON_VOL_UP
;
48 new_btn
= BUTTON_RC_VOL_UP
;
51 new_btn
= BUTTON_VOL_DOWN
;
54 new_btn
= BUTTON_RC_VOL_DOWN
;
57 new_btn
= BUTTON_MODE
;
60 new_btn
= BUTTON_RC_MODE
;
66 new_btn
= BUTTON_RC_REC
;
69 new_btn
= BUTTON_PLAY
;
72 new_btn
= BUTTON_RC_PLAY
;
76 new_btn
= BUTTON_RC_MENU
;
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" },
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" }