#include "key-impl.h"
// EXTERNAL INCLUDES
-#define KEY_VOLUMEUP "XF86AudioRaiseVolume" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Volume Up' key */
-#define KEY_VOLUMEDOWN "XF86AudioLowerVolume" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Volume Down' key */
-
-#define KEY_CAMERA "XF86WebCam" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Half-Press of Camera' key */
-#define KEY_CONFIG "XF86Pictures" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Full-Press of Camera' key */
-
-#define KEY_POWER "XF86PowerOff" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Power' key */
-#define KEY_PAUSE "XF86Standby" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Pause' key */
-#define KEY_CANCEL "Cancel" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Cancel' key */
-
-// Earjack/BT Headset/Multimedia keys
-#define KEY_PLAYCD "XF86AudioPlay" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Play Audio' key */
-#define KEY_STOPCD "XF86AudioStop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Stop Audio' key */
-#define KEY_PAUSECD "XF86AudioPause" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Pause Audio' key */
-#define KEY_NEXTSONG "XF86AudioNext" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Next Song' key */
-#define KEY_PREVIOUSSONG "XF86AudioPrev" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Previous Song' key */
-#define KEY_REWIND "XF86AudioRewind" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Rewind Song' key */
-#define KEY_FASTFORWARD "XF86AudioForward" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Forward Song' key */
-#define KEY_MEDIA "XF86AudioMedia" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Media' key */
-#define KEY_PLAYPAUSE "XF86AudioPlayPause" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'PlayPause' key */
-#define KEY_MUTE "XF86AudioMute" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Mute' key */
-
-// 3-Touch key
-#define KEY_SEND "XF86Send" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Send' key */
-#define KEY_SELECT "XF86Phone" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Home' key */
-#define KEY_END "XF86Stop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'End' key */
-
-// Renamed 3-Touch key
-#define KEY_MENU "XF86Send" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Send' key */
-#define KEY_HOME "XF86Phone" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Home' key */
-#define KEY_BACK "XF86Stop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'End' key */
-
-//Other functions keys
-#define KEY_HOMEPAGE "XF86HomePage" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'HomePage' key */
-#define KEY_WEBPAGE "XF86WWW" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'WWW' key */
-#define KEY_MAIL "XF86Mail" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Mail' key */
-#define KEY_SCREENSAVER "XF86ScreenSaver" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'ScreenSaver' key */
-#define KEY_BRIGHTNESSUP "XF86MonBrightnessUp" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'BrightnessUp' key */
-#define KEY_BRIGHTNESSDOWN "XF86MonBrightnessDown" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'BrightnessDown' key */
-#define KEY_SOFTKBD "XF86MenuKB" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Soft keyboard(toggle)' key */
-#define KEY_QUICKPANEL "XF86Tools" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Quick panel(toggle)' key */
-#define KEY_TASKSWITCH "XF86TaskPane" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Task switcher(toggle)' key */
-#define KEY_APPS "XF86Launch0" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Apptray(toggle)' key */
-#define KEY_SEARCH "XF86Search" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Search(toggle)' key */
-#define KEY_VOICE "XF86Launch2" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Voice(toggle)' key */
-#define KEY_LANGUAGE "Hangul" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Language(toggle)' key */
-
#include <map>
#include <string.h>
#include <iostream>
-
#include <dali/integration-api/debug.h>
{ "Escape", DALI_KEY_ESCAPE, false }, // item not defined in utilX
{ "Menu", DALI_KEY_MENU, false }, // item not defined in utilX
- { KEY_CAMERA, DALI_KEY_CAMERA, false },
- { KEY_CONFIG, DALI_KEY_CONFIG, false },
- { KEY_POWER, DALI_KEY_POWER, true },
- { KEY_PAUSE, DALI_KEY_PAUSE, false },
- { KEY_CANCEL, DALI_KEY_CANCEL, false },
- { KEY_PLAYCD, DALI_KEY_PLAY_CD, false },
- { KEY_STOPCD, DALI_KEY_STOP_CD, false },
- { KEY_PAUSECD, DALI_KEY_PAUSE_CD, false },
- { KEY_NEXTSONG, DALI_KEY_NEXT_SONG, false },
- { KEY_PREVIOUSSONG, DALI_KEY_PREVIOUS_SONG, false },
- { KEY_REWIND, DALI_KEY_REWIND, false },
- { KEY_FASTFORWARD, DALI_KEY_FASTFORWARD, false },
- { KEY_MEDIA, DALI_KEY_MEDIA, false },
- { KEY_PLAYPAUSE, DALI_KEY_PLAY_PAUSE, false },
- { KEY_MUTE, DALI_KEY_MUTE, false },
- { KEY_SEND, DALI_KEY_SEND, true },
- { KEY_SELECT, DALI_KEY_SELECT, true },
- { KEY_END, DALI_KEY_END, true },
- { KEY_MENU, DALI_KEY_MENU, true },
- { KEY_HOME, DALI_KEY_HOME, true },
- { KEY_BACK, DALI_KEY_BACK, true },
- { KEY_HOMEPAGE, DALI_KEY_HOMEPAGE, false },
- { KEY_WEBPAGE, DALI_KEY_WEBPAGE, false },
- { KEY_MAIL, DALI_KEY_MAIL, false },
- { KEY_SCREENSAVER, DALI_KEY_SCREENSAVER, false },
- { KEY_BRIGHTNESSUP, DALI_KEY_BRIGHTNESS_UP, false },
- { KEY_BRIGHTNESSDOWN, DALI_KEY_BRIGHTNESS_DOWN, false },
- { KEY_SOFTKBD, DALI_KEY_SOFT_KBD, false },
- { KEY_QUICKPANEL, DALI_KEY_QUICK_PANEL, false },
- { KEY_TASKSWITCH, DALI_KEY_TASK_SWITCH, false },
- { KEY_APPS, DALI_KEY_APPS, false },
- { KEY_SEARCH, DALI_KEY_SEARCH, false },
- { KEY_VOICE, DALI_KEY_VOICE, false },
- { KEY_LANGUAGE, DALI_KEY_LANGUAGE, false },
- { KEY_VOLUMEUP, DALI_KEY_VOLUME_UP, true },
- { KEY_VOLUMEDOWN, DALI_KEY_VOLUME_DOWN, true },
+
+ // Now the key names are used as literal string not defined symbols,
+ // since these definition in utilX.h is deprecated and we're guided not to use them
+ { "XF86Camera", DALI_KEY_CAMERA, false },
+ { "XF86Camera_Full", DALI_KEY_CONFIG, false },
+ { "XF86PowerOff", DALI_KEY_POWER, true },
+ { "XF86Standby", DALI_KEY_PAUSE, false },
+ { "Cancel", DALI_KEY_CANCEL, false },
+ { "XF86AudioPlay", DALI_KEY_PLAY_CD, false },
+ { "XF86AudioStop", DALI_KEY_STOP_CD, false },
+ { "XF86AudioPause", DALI_KEY_PAUSE_CD, false },
+ { "XF86AudioNext", DALI_KEY_NEXT_SONG, false },
+ { "XF86AudioPrev", DALI_KEY_PREVIOUS_SONG, false },
+ { "XF86AudioRewind", DALI_KEY_REWIND, false },
+ { "XF86AudioForward", DALI_KEY_FASTFORWARD, false },
+ { "XF86AudioMedia", DALI_KEY_MEDIA, false },
+ { "XF86AudioPlayPause", DALI_KEY_PLAY_PAUSE, false },
+ { "XF86AudioMute", DALI_KEY_MUTE, false },
+ { "XF86Send", DALI_KEY_SEND, true },
+ { "XF86Phone", DALI_KEY_SELECT, true },
+ { "XF86Stop", DALI_KEY_END, true },
+ { "XF86Menu", DALI_KEY_MENU, true },
+ { "XF86Home", DALI_KEY_HOME, true },
+ { "XF86Back", DALI_KEY_BACK, true },
+ { "XF86HomePage", DALI_KEY_HOMEPAGE, false },
+ { "XF86WWW", DALI_KEY_WEBPAGE, false },
+ { "XF86Mail", DALI_KEY_MAIL, false },
+ { "XF86ScreenSaver", DALI_KEY_SCREENSAVER, false },
+ { "XF86MonBrightnessUp", DALI_KEY_BRIGHTNESS_UP, false },
+ { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false },
+ { "XF86SoftKBD", DALI_KEY_SOFT_KBD, false },
+ { "XF86QuickPanel", DALI_KEY_QUICK_PANEL, false },
+ { "XF86TaskPane", DALI_KEY_TASK_SWITCH, false },
+ { "XF86Apps", DALI_KEY_APPS, false },
+ { "XF86Search", DALI_KEY_SEARCH, false },
+ { "XF86Voice", DALI_KEY_VOICE, false },
+ { "Hangul", DALI_KEY_LANGUAGE, false },
+ { "XF86AudioRaiseVolume", DALI_KEY_VOLUME_UP, true },
+ { "XF86AudioLowerVolume", DALI_KEY_VOLUME_DOWN, true },
};
const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable))/ (sizeof(KeyLookup));
}
}
+ const char* GetKeyName( int daliKeyCode ) const
+ {
+ for( size_t i = 0; i < KEY_LOOKUP_COUNT ; ++i )
+ {
+ const KeyLookup& keyLookup( KeyLookupTable[i] );
+ if( keyLookup.daliKeyCode == daliKeyCode )
+ {
+ return keyLookup.keyName;
+ }
+ }
+ return "";
+ }
+
bool IsDeviceButton( const char* keyName ) const
{
Lookup::const_iterator i = mLookup.find( keyName );
return globalKeyLookup.IsDeviceButton( keyName );
}
+const char* GetKeyName( Dali::KEY daliKey )
+{
+ return globalKeyLookup.GetKeyName( daliKey );
+}
+
} // namespace KeyLookup
} // namespace Adaptor