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 ****************************************************************************/
26 #include "buttonmap.h"
28 int key_to_button(int keyboard_button
)
30 int new_btn
= BUTTON_NONE
;
31 switch (keyboard_button
)
35 new_btn
= BUTTON_LEFT
;
39 new_btn
= BUTTON_RIGHT
;
47 new_btn
= BUTTON_DOWN
;
51 new_btn
= BUTTON_PLAY
;
54 new_btn
= BUTTON_POWER
;
59 new_btn
= BUTTON_POWER
;
67 new_btn
= BUTTON_SELECT
;
73 struct 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" },
95 { 0, 0, 0, 0, "None" }