Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

Common::HardwareKeySet * OSystem_SDL::getHardwareKeySet (  ) [virtual, inherited]

Register hardware keys with keymapper

Returns:
HardwareKeySet with all keys and recommended mappings

See keymapper documentation for further reference.

Reimplemented from ModularBackend.

Reimplemented in OSystem_LINUXMOTO, and OSystem_SDL_WebOS.

Definition at line 199 of file hardwarekeys.cpp.

Referenced by OSystem_LINUXMOTO::getHardwareKeySet().

                                                     {
#ifdef ENABLE_KEYMAPPER
      HardwareKeySet *keySet = new HardwareKeySet();
      const Key *key;
      const Mod *mod;
      char fullKeyId[50];
      char fullKeyDesc[100];
      uint16 ascii;

      for (mod = modifiers; mod->id; mod++) {
            for (key = keys; key->hwId; key++) {
                  ascii = key->ascii;

                  if (mod->shiftable && key->shiftable) {
                        snprintf(fullKeyId, 50, "%s%c", mod->id, toupper(key->hwId[0]));
                        snprintf(fullKeyDesc, 100, "%s%c", mod->desc, toupper(key->desc[0]));
                        ascii = toupper(key->ascii);
                  } else if (mod->shiftable) {
                        snprintf(fullKeyId, 50, "S+%s%s", mod->id, key->hwId);
                        snprintf(fullKeyDesc, 100, "Shift+%s%s", mod->desc, key->desc);
                  } else {
                        snprintf(fullKeyId, 50, "%s%s", mod->id, key->hwId);
                        snprintf(fullKeyDesc, 100, "%s%s", mod->desc, key->desc);
                  }

                  keySet->addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, mod->flag), fullKeyDesc, key->preferredAction ));
            }
      }

      return keySet;

#else
      return 0;
#endif
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index