summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2004-12-09 17:47:37 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2004-12-09 17:47:37 +0000
commit5bbd61b0a2180b73bfb32dc1b1981ea04e70c471 (patch)
tree5fd035dc70436ee2107c3a24160f19fb8d5a3be7
parentc2c691ff03eead575f051c09898b6f4f5eca6c10 (diff)
downloadtigervnc-5bbd61b0a2180b73bfb32dc1b1981ea04e70c471.tar.gz
tigervnc-5bbd61b0a2180b73bfb32dc1b1981ea04e70c471.zip
Added hot keys support to RfbPlayer
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@34 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--rfbplayer/resource.h6
-rw-r--r--rfbplayer/rfbplayer.cxx7
-rw-r--r--rfbplayer/rfbplayer.rc25
3 files changed, 34 insertions, 4 deletions
diff --git a/rfbplayer/resource.h b/rfbplayer/resource.h
index 0199f48b..f8ae33f1 100644
--- a/rfbplayer/resource.h
+++ b/rfbplayer/resource.h
@@ -6,6 +6,7 @@
#define IDI_ICON1 105
#define IDI_ICON 105
#define IDR_MENU 128
+#define IDR_ACCELERATOR 131
#define IDC_BUTTON1 1000
#define IDC_EDIT1 1001
#define IDC_EDIT2 1002
@@ -26,13 +27,14 @@
#define ID_HELP_HOMEPAGE 40025
#define ID_HELP_COMMANDLINESEITCHES 40026
#define ID_HELP_ABOUT 40027
+#define ID_OPTIONS 40029
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 129
-#define _APS_NEXT_COMMAND_VALUE 40028
+#define _APS_NEXT_RESOURCE_VALUE 132
+#define _APS_NEXT_COMMAND_VALUE 40030
#define _APS_NEXT_CONTROL_VALUE 1003
#define _APS_NEXT_SYMED_VALUE 101
#endif
diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx
index f52561f8..dc0786cc 100644
--- a/rfbplayer/rfbplayer.cxx
+++ b/rfbplayer/rfbplayer.cxx
@@ -1017,10 +1017,13 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prevInst, char* cmdLine, int cmdSho
}
// Run the player
+ HACCEL hAccel = LoadAccelerators(inst, MAKEINTRESOURCE(IDR_ACCELERATOR));
MSG msg;
while (GetMessage(&msg, NULL, 0, 0) > 0) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
+ if(!TranslateAccelerator(player->getMainHandle(), hAccel, &msg)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
}
// Wait while the thread destroying and then destroy the player
diff --git a/rfbplayer/rfbplayer.rc b/rfbplayer/rfbplayer.rc
index d7b79b13..1241d30f 100644
--- a/rfbplayer/rfbplayer.rc
+++ b/rfbplayer/rfbplayer.rc
@@ -163,6 +163,31 @@ BEGIN
END
END
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDR_ACCELERATOR ACCELERATORS DISCARDABLE
+BEGIN
+ "C", ID_PLAY_STOP, VIRTKEY, NOINVERT
+ "C", ID_FRAME_COPYTOCLIPBOARD, VIRTKEY, CONTROL, NOINVERT
+ "C", ID_FRAME_EXTRACT, VIRTKEY, ALT, NOINVERT
+ "G", ID_PLAY_GOTO, VIRTKEY, CONTROL, NOINVERT
+ "L", ID_PLAY_LOOP, VIRTKEY, CONTROL, NOINVERT
+ "O", ID_FILE_OPENFILE, VIRTKEY, CONTROL, NOINVERT
+ "P", ID_OPTIONS, VIRTKEY, CONTROL, NOINVERT
+ "Q", ID_FILE_CLOSEFILE, VIRTKEY, CONTROL, NOINVERT
+ "S", ID_PLAY_SETSPEED, VIRTKEY, CONTROL, NOINVERT
+ VK_F5, ID_VIEW_ZOOM_50, VIRTKEY, NOINVERT
+ VK_F6, ID_VIEW_ZOOM_100, VIRTKEY, NOINVERT
+ VK_F7, ID_VIEW_ZOOM_200, VIRTKEY, NOINVERT
+ VK_RETURN, ID_VIEW_FULLSCREEN, VIRTKEY, ALT, NOINVERT
+ VK_SPACE, ID_PLAY_PLAYPAUSE, VIRTKEY, NOINVERT
+ "X", ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT
+END
+
#endif // English (U.K.) resources
/////////////////////////////////////////////////////////////////////////////