[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 794
Date       : Mon Apr 10 11:30:41 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/keypress.cpp

Fix 'shift' and other function key handling in texttool (Bugzilla #921)


Diff:
Index: Trunk/XaraLX/wxOil/keypress.cpp
===================================================================
--- Trunk/XaraLX/wxOil/keypress.cpp	(revision 793)
+++ Trunk/XaraLX/wxOil/keypress.cpp	(revision 794)
@@ -990,6 +990,23 @@
 #if FALSE != wxUSE_UNICODE
 		NumChars = 1;
 		pWideChar[0] = pKeySysMsg->m_Char;
+		
+		// We still have to try our custom translations (for VirtKey >= WXK_START
+		if( pKeySysMsg->VirtKey >= WXK_START )
+		{
+			for( INT32 i = 0; ExtraUnicodes[i].VirtKey != CAMKEY(CC_NONE); ++i )
+			{
+				// We have found an entry in our table for the given virtual key
+				if( ExtraUnicodes[i].VirtKey == pKeySysMsg->VirtKey )
+					// Stuff the Unicode value into the buffer and set the num chars generated to 1
+					pWideChar[0] = ExtraUnicodes[i].Unicode;
+			}
+			
+			// Don't pass on unknown function keys
+			if( ExtraUnicodes[i].VirtKey == CAMKEY(CC_NONE) )
+				NumChars = 0;
+		}
+		
 #elif defined(__WXMSW__)
 		BYTE pKeyState[256];			// Array to hold the current state of the keyboard
 		if (GetKeyboardState(pKeyState))	// Scan the current keyboard state


Xara