reversi: Fix viewport initialization. Improve button layout for portrait. Enable...
[maemo-rb.git] / uisimulator / buttonmap / mpio-hd300.c
blob454e3a6d6f8420c148d11b55342cac3a79ccffbe
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
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 ****************************************************************************/
23 #include <SDL.h>
24 #include "button.h"
25 #include "buttonmap.h"
27 int key_to_button(int keyboard_button)
29 int new_btn = BUTTON_NONE;
30 switch (keyboard_button)
33 case SDLK_UP:
34 new_btn = BUTTON_UP;
35 break;
36 case SDLK_DOWN:
37 new_btn = BUTTON_DOWN;
38 break;
40 case SDLK_LEFT:
41 new_btn = BUTTON_LEFT;
42 break;
43 case SDLK_RIGHT:
44 new_btn = BUTTON_RIGHT;
45 break;
47 case SDLK_SPACE:
48 case SDLK_ESCAPE:
49 new_btn = BUTTON_MENU;
50 break;
52 case SDLK_RETURN:
53 new_btn = BUTTON_ENTER;
54 break;
56 case SDLK_p:
57 new_btn = BUTTON_PLAY;
58 break;
60 case SDLK_r:
61 new_btn = BUTTON_REC;
62 break;
64 return new_btn;
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" }