Skip to content

Commit

Permalink
MAEMO: Rename hasHwKeyboard and add hasMenuKey
Browse files Browse the repository at this point in the history
  • Loading branch information
tsoliman committed Feb 15, 2012
1 parent 856744a commit 7ae7e80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions backends/events/maemosdl/maemosdl-events.cpp
Expand Up @@ -36,7 +36,7 @@ MaemoSdlEventSource::MaemoSdlEventSource() : SdlEventSource(), _clickEnabled(tru
bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {

Model model = Model(((OSystem_SDL_Maemo *)g_system)->getModel());
debug(10, "Model: %s %u %s %s", model.hwId, model.modelType, model.hwAlias, model.hwKeyboard ? "true" : "false");
debug(10, "Model: %s %u %s %s", model.hwId, model.modelType, model.hwAlias, model.hasHwKeyboard ? "true" : "false");

// List of special N810 keys:
// SDLK_F4 -> menu
Expand All @@ -56,7 +56,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
debug(9, "remapping to main menu");
return true;
} else if (ev.key.keysym.sym == SDLK_F6) {
if (!model.hwKeyboard) {
if (!model.hasHwKeyboard) {
event.type = Common::EVENT_KEYDOWN;
event.kbd.keycode = Common::KEYCODE_F7;
event.kbd.ascii = Common::ASCII_F7;
Expand Down Expand Up @@ -95,7 +95,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MAINMENU;
return true;
} else if (ev.key.keysym.sym == SDLK_F6) {
if (!model.hwKeyboard) {
if (!model.hasHwKeyboard) {
event.type = Common::EVENT_KEYUP;
event.kbd.keycode = Common::KEYCODE_F7;
event.kbd.ascii = Common::ASCII_F7;
Expand Down
15 changes: 8 additions & 7 deletions backends/platform/maemo/maemo-common.h
Expand Up @@ -39,16 +39,17 @@ struct Model {
const char *hwId;
ModelType modelType;
const char *hwAlias;
bool hwKeyboard;
bool hasHwKeyboard;
bool hasMenuKey;
};

static const Model models[] = {
{"SU-18", kModelType770, "770", false},
{"RX-34", kModelTypeN800, "N800", false},
{"RX-44", kModelTypeN810, "N810", true},
{"RX-48", kModelTypeN810, "N810W", true},
{"RX-51", kModelTypeN900, "N900", true},
{0, kModelTypeInvalid, 0, true}
{"SU-18", kModelType770, "770", false, true},
{"RX-34", kModelTypeN800, "N800", false, true},
{"RX-44", kModelTypeN810, "N810", true, true},
{"RX-48", kModelTypeN810, "N810W", true, true},
{"RX-51", kModelTypeN900, "N900", true, false},
{0, kModelTypeInvalid, 0, true, true}
};

enum CustomEventType {
Expand Down

0 comments on commit 7ae7e80

Please sign in to comment.