diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-27 15:46:09 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-27 15:46:09 +0100 |
commit | 194b63c424cf280dee3c53099affdb11ade6ce3c (patch) | |
tree | 7abe3b23626c393c0e4af5cf36dfdc9d9d2f1110 /src | |
parent | b98c9ce86e9f58801d0587c16bc392c7ac228cc5 (diff) | |
download | pluggit-194b63c424cf280dee3c53099affdb11ade6ce3c.tar.gz pluggit-194b63c424cf280dee3c53099affdb11ade6ce3c.tar.bz2 pluggit-194b63c424cf280dee3c53099affdb11ade6ce3c.zip |
Add stub implementation of KeySend
Diffstat (limited to 'src')
-rw-r--r-- | src/KeySend_x11.cpp | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/src/KeySend_x11.cpp b/src/KeySend_x11.cpp new file mode 100644 index 0000000..b33b248 --- /dev/null +++ b/src/KeySend_x11.cpp @@ -0,0 +1,107 @@ +#include <stdio.h>
+
+#include "KeySend.h"
+
+CKeySend::CKeySend()
+{
+}
+
+CKeySend::~CKeySend()
+{
+}
+
+
+void CKeySend::SendKeyDown(unsigned char bVk)
+{
+#if 0
+ BYTE bScan = LOBYTE(::MapVirtualKey(bVk, 0));
+ DWORD dwFlags = (IsVkExtended(bVk) ? KEYEVENTF_EXTENDEDKEY : 0 );
+ KeyboardEvent(bVk,bScan,dwFlags);
+#endif
+}
+
+void CKeySend::SendKeyUp(unsigned char bVk)
+{
+#if 0
+ BYTE bScan = LOBYTE(::MapVirtualKey(bVk, 0));
+ DWORD dwFlags = (IsVkExtended(bVk) ? KEYEVENTF_EXTENDEDKEY : 0 ) | KEYEVENTF_KEYUP;
+ KeyboardEvent(bVk,bScan,dwFlags);
+#endif
+}
+
+void CKeySend::KeyboardEvent(unsigned char bVk, unsigned char bScan, unsigned long dwFlags)
+{
+#if 0
+ ::keybd_event(bVk, bScan, dwFlags, 0);
+#endif
+}
+
+bool CKeySend::IsVkExtended(unsigned char bVk)
+{
+ bool bExtended = false;
+#if 0
+ if( (bVk == VK_UP ) ||
+ (bVk == VK_DOWN ) ||
+ (bVk == VK_LEFT ) ||
+ (bVk == VK_RIGHT ) ||
+ (bVk == VK_HOME ) ||
+ (bVk == VK_END ) ||
+ (bVk == VK_PRIOR ) ||
+ (bVk == VK_NEXT ) ||
+ (bVk == VK_INSERT ) ||
+ (bVk == VK_DELETE ) ||
+ (bVk == VK_UP ) )
+ {
+ bExtended = true;
+ }
+#endif
+ return bExtended;
+
+}
+
+int CKeySend::MapDfbKeyEventToVK(unsigned short symbol)
+{
+#if 0
+ switch(symbol)
+ {
+ case 0xF000 : return VK_LEFT;
+ case 0xF001 : return VK_RIGHT;
+ case 0xF002 : return VK_UP;
+ case 0xF003 : return VK_DOWN;
+ case 0xF00b : return VK_RETURN;
+
+ case 0xF046 : return VK_PRIOR; //p+
+ case 0xF047 : return VK_NEXT; //p-
+
+ case 0xF050 : return -1; // play
+ case 0xF05A : return -1; // FF
+ case 0xF059 : return -1; // rew
+ case 0xF052 : return -1; // stop
+ case 0xF056 : return -1; // REC
+
+ case 0xF05B : return VK_BACK; // back key
+
+ case 0xF042 : return -1; // Red
+ case 0xF043 : return -1; // Green
+ case 0xF045 : return -1; // Blue
+
+ case 0xF011 : return -1; // options
+ case 0xF032 : return -1; // teletext
+ case 0xF014 : return -1; // info
+
+ case 0x0030 : return 0x30; // 0-9
+ case 0x0031 : return 0x31; // 0-9
+ case 0x0032 : return 0x32; // 0-9
+ case 0x0033 : return 0x33; // 0-9
+ case 0x0034 : return 0x34; // 0-9
+ case 0x0035 : return 0x35; // 0-9
+ case 0x0036 : return 0x36; // 0-9
+ case 0x0037 : return 0x37; // 0-9
+ case 0x0038 : return 0x38; // 0-9
+ case 0x0039 : return 0x39; // 0-9
+ default:
+ return -1;
+ }
+#endif
+ return -1;
+}
|