Browse Source

Fixed issue with text only paste with control-shift-v not working

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@729 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 11 years ago
parent
commit
be4ce2af57
1 changed files with 16 additions and 2 deletions
  1. 16 2
      SendKeys.cpp

+ 16 - 2
SendKeys.cpp

@@ -210,14 +210,28 @@ CString CSendKeys::VkString(BYTE VKey)
 
 
 void CSendKeys::AllKeysUp()
 void CSendKeys::AllKeysUp()
 {
 {
-	for(int key = 0; key < 256; key++)
+	for (int key = 0; key < 256; key++)
 	{
 	{
 		//If the key is pressed, send a key up, having other keys down interferes with sending ctrl-v, -c and -x
 		//If the key is pressed, send a key up, having other keys down interferes with sending ctrl-v, -c and -x
-		if(GetKeyState(key) & 0x8000)
+		short val = GetKeyState(key);
+		if (val & 0x8000)
 		{
 		{
 			SendKeyUp(key);
 			SendKeyUp(key);
+
+			//CString cs;
+			//cs.Format(_T("key was down, sending key up %d, value: %d\n"), key, val);
+			//OutputDebugString(cs);
 		}
 		}
 	}
 	}
+
+	//Force these to be up, i was having trouble with the right shift key, i think things were
+	//getting confused between the basic shift and lshift, but not sure.
+	SendKeyUp(VK_LSHIFT);
+	SendKeyUp(VK_RSHIFT);
+	SendKeyUp(VK_LCONTROL);
+	SendKeyUp(VK_RCONTROL);
+	SendKeyUp(VK_LMENU);
+	SendKeyUp(VK_RMENU);
 }
 }
 
 
 // Generates KEYUP
 // Generates KEYUP