1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2006 Dan Everton
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
)
34 new_btn
= BUTTON_LEFT
;
38 new_btn
= BUTTON_RIGHT
;
46 new_btn
= BUTTON_DOWN
;
63 new_btn
= BUTTON_SELECT
;
67 new_btn
= BUTTON_MODE
;
73 struct button_map bm
[] = {
74 #if defined (IRIVER_H120) || defined (IRIVER_H100)
75 { SDLK_KP_DIVIDE
, 46, 162, 13, "Record" },
76 { SDLK_KP_PLUS
, 327, 36, 16, "Play" },
77 { SDLK_KP_ENTER
, 330, 99, 18, "Stop" },
78 { SDLK_KP_PERIOD
, 330, 163, 18, "AB" },
79 { SDLK_KP5
, 186, 227, 27, "5" },
80 { SDLK_KP8
, 187, 185, 19, "8" },
81 { SDLK_KP4
, 142, 229, 23, "4" },
82 { SDLK_KP6
, 231, 229, 22, "6" },
83 { SDLK_KP2
, 189, 272, 28, "2" },
85 { SDLK_KP_ENTER
, 250, 404, 20, "Stop" },
86 { SDLK_SPACE
, 285, 439, 29, "Space" },
87 { SDLK_h
, 336, 291, 24, "Hold" },
88 #elif defined (IRIVER_H300)
89 { SDLK_KP_PLUS
, 56, 335, 20, "Play" },
90 { SDLK_KP8
, 140, 304, 29, "Up" },
91 { SDLK_KP_DIVIDE
, 233, 331, 23, "Record" },
92 { SDLK_KP_ENTER
, 54, 381, 24, "Stop" },
93 { SDLK_KP4
, 100, 353, 17, "Left" },
94 { SDLK_KP5
, 140, 351, 19, "Navi" },
95 { SDLK_KP6
, 185, 356, 19, "Right" },
96 { SDLK_KP_PERIOD
, 230, 380, 20, "AB" },
97 { SDLK_KP2
, 142, 402, 24, "Down" },
98 { SDLK_KP_ENTER
, 211, 479, 21, "Stop" },
99 { SDLK_KP_PLUS
, 248, 513, 29, "Play" },
101 { 0, 0, 0, 0, "None" }