diff --git a/examples/pxScene2d/src/pxWayland.cpp b/examples/pxScene2d/src/pxWayland.cpp index 85252d754c..07e85df951 100644 --- a/examples/pxScene2d/src/pxWayland.cpp +++ b/examples/pxScene2d/src/pxWayland.cpp @@ -990,6 +990,9 @@ rtError pxWayland::connectToRemoteObject(unsigned int timeout_ms) #define KEY_PLAY 207 #define KEY_FASTFORWARD 208 #define KEY_PRINT 210 /* AC Print */ +#define KEY_BACK 158 +#define KEY_MENU 139 +#define KEY_HOMEPAGE 172 uint32_t pxWayland::linuxFromPX( uint32_t keyCode ) { @@ -1312,6 +1315,15 @@ uint32_t pxWayland::linuxFromPX( uint32_t keyCode ) case PX_KEY_GREEN: linuxKeyCode = KEY_GREEN; break; + case PX_KEY_BACK: + linuxKeyCode = KEY_BACK; + break; + case PX_KEY_MENU: + linuxKeyCode = KEY_MENU; + break; + case PX_KEY_HOMEPAGE: + linuxKeyCode = KEY_HOMEPAGE; + break; default: linuxKeyCode= -1; break; diff --git a/examples/pxScene2d/src/rcvrcore/tools/keys.js b/examples/pxScene2d/src/rcvrcore/tools/keys.js index 9e035eac1e..284aaf058c 100644 --- a/examples/pxScene2d/src/rcvrcore/tools/keys.js +++ b/examples/pxScene2d/src/rcvrcore/tools/keys.js @@ -121,7 +121,14 @@ var keys = // HELP : 10038 //TODO DECIMAL : 190, BACKQUOTE : 192, - QUOTE : 222 + QUOTE : 222, + FAST_FORWARD : 223, + REWIND : 224, + PLAY : 226, + PLAYPAUSE : 227, + BACK : 407, + MENU : 408, + HOMEPAGE : 409 }; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/essos/pxWindowNative.h b/src/essos/pxWindowNative.h index f60a2963a6..ac737c4021 100755 --- a/src/essos/pxWindowNative.h +++ b/src/essos/pxWindowNative.h @@ -250,5 +250,13 @@ class pxWindowNative #define PX_KEY_NATIVE_HELP KEY_HELP #define PX_KEY_NATIVE_BACKQUOTE KEY_GRAVE #define PX_KEY_NATIVE_QUOTE KEY_APOSTROPHE +#define PX_KEY_NATIVE_PLAYPAUSE KEY_PLAYPAUSE +#define PX_KEY_NATIVE_PLAY KEY_PLAY +#define PX_KEY_NATIVE_FASTFORWARD KEY_FASTFORWARD +#define PX_KEY_NATIVE_REWIND KEY_REWIND +#define PX_KEY_NATIVE_KPENTER KEY_KPENTER +#define PX_KEY_NATIVE_BACK KEY_BACK +#define PX_KEY_NATIVE_MENU KEY_MENU +#define PX_KEY_NATIVE_HOMEPAGE KEY_HOMEPAGE #endif diff --git a/src/pxKeycodes.h b/src/pxKeycodes.h index de0feebb25..5648c68397 100644 --- a/src/pxKeycodes.h +++ b/src/pxKeycodes.h @@ -144,4 +144,8 @@ #define PX_KEY_BLUE 404 #define PX_KEY_RED 405 #define PX_KEY_GREEN 406 + +#define PX_KEY_BACK 407 +#define PX_KEY_MENU 408 +#define PX_KEY_HOMEPAGE 409 #endif //PX_KEYCODES_H diff --git a/src/pxWindowUtil.cpp b/src/pxWindowUtil.cpp index efd192e282..f13b4176e7 100644 --- a/src/pxWindowUtil.cpp +++ b/src/pxWindowUtil.cpp @@ -346,6 +346,55 @@ uint32_t keycodeFromNative(uint32_t nativeKeycode) case PX_KEY_NATIVE_QUOTE: commonKeycode = PX_KEY_SINGLEQUOTE; break; +/* Handling Keys that are common in Multimedia Remote/Keyboard */ +#ifdef PX_KEY_NATIVE_PLAYPAUSE + case PX_KEY_NATIVE_PLAYPAUSE: + commonKeycode = PX_KEY_PLAYPAUSE; + break; +#endif /* PX_KEY_NATIVE_PLAYPAUSE */ + +#ifdef PX_KEY_NATIVE_PLAY + case PX_KEY_NATIVE_PLAY: + commonKeycode = PX_KEY_PLAY; + break; +#endif /* PX_KEY_NATIVE_PLAY */ + +#ifdef PX_KEY_NATIVE_FASTFORWARD + case PX_KEY_NATIVE_FASTFORWARD: + commonKeycode = PX_KEY_FASTFORWARD; + break; +#endif /* PX_KEY_FASTFORWARD */ + +#ifdef PX_KEY_NATIVE_REWIND + case PX_KEY_NATIVE_REWIND: + commonKeycode = PX_KEY_REWIND; + break; +#endif /* PX_KEY_NATIVE_REWIND */ + +#ifdef PX_KEY_NATIVE_KPENTER + case PX_KEY_NATIVE_KPENTER: + commonKeycode = PX_KEY_ENTER; + break; +#endif /* PX_KEY_NATIVE_KPENTER */ + +#ifdef PX_KEY_NATIVE_BACK + case PX_KEY_NATIVE_BACK: + commonKeycode = PX_KEY_BACK; + break; +#endif /* PX_KEY_NATIVE_BACK */ + +#ifdef PX_KEY_NATIVE_MENU + case PX_KEY_NATIVE_MENU: + commonKeycode = PX_KEY_MENU; + break; +#endif /* PX_KEY_NATIVE_MENU */ + +#ifdef PX_KEY_NATIVE_HOMEPAGE + case PX_KEY_NATIVE_HOMEPAGE: + commonKeycode = PX_KEY_HOMEPAGE; + break; +#endif /* PX_KEY_NATIVE_HOMEPAGE */ + default: //TODO move rtLog support to pxCore so we can use here printf("pxWindowUtils: Unhandled keycode %d\n", nativeKeycode); diff --git a/src/wayland/pxWindowNative.h b/src/wayland/pxWindowNative.h index 519b347eff..8125d2959e 100755 --- a/src/wayland/pxWindowNative.h +++ b/src/wayland/pxWindowNative.h @@ -279,5 +279,13 @@ pxWindowNative(): mTimerFPS(0), mLastWidth(-1), mLastHeight(-1), #define PX_KEY_NATIVE_HELP KEY_HELP #define PX_KEY_NATIVE_BACKQUOTE KEY_GRAVE #define PX_KEY_NATIVE_QUOTE KEY_APOSTROPHE +#define PX_KEY_NATIVE_PLAYPAUSE KEY_PLAYPAUSE +#define PX_KEY_NATIVE_PLAY KEY_PLAY +#define PX_KEY_NATIVE_FASTFORWARD KEY_FASTFORWARD +#define PX_KEY_NATIVE_REWIND KEY_REWIND +#define PX_KEY_NATIVE_KPENTER KEY_KPENTER +#define PX_KEY_NATIVE_BACK KEY_BACK +#define PX_KEY_NATIVE_MENU KEY_MENU +#define PX_KEY_NATIVE_HOMEPAGE KEY_HOMEPAGE #endif diff --git a/src/wayland_egl/pxWindowNative.h b/src/wayland_egl/pxWindowNative.h index 967abcf338..8dbd90f0a1 100755 --- a/src/wayland_egl/pxWindowNative.h +++ b/src/wayland_egl/pxWindowNative.h @@ -302,5 +302,13 @@ class pxWindowNative #define PX_KEY_NATIVE_HELP KEY_HELP #define PX_KEY_NATIVE_BACKQUOTE KEY_GRAVE #define PX_KEY_NATIVE_QUOTE KEY_APOSTROPHE +#define PX_KEY_NATIVE_PLAYPAUSE KEY_PLAYPAUSE +#define PX_KEY_NATIVE_PLAY KEY_PLAY +#define PX_KEY_NATIVE_FASTFORWARD KEY_FASTFORWARD +#define PX_KEY_NATIVE_REWIND KEY_REWIND +#define PX_KEY_NATIVE_KPENTER KEY_KPENTER +#define PX_KEY_NATIVE_BACK KEY_BACK +#define PX_KEY_NATIVE_MENU KEY_MENU +#define PX_KEY_NATIVE_HOMEPAGE KEY_HOMEPAGE #endif