Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions examples/pxScene2d/src/pxWayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 8 additions & 1 deletion examples/pxScene2d/src/rcvrcore/tools/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
8 changes: 8 additions & 0 deletions src/essos/pxWindowNative.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions src/pxKeycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
49 changes: 49 additions & 0 deletions src/pxWindowUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions src/wayland/pxWindowNative.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions src/wayland_egl/pxWindowNative.h
Original file line number Diff line number Diff line change
Expand Up @@ -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