[Bug 10549] New: GetKeyNameText returns different text from Windows

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Nov 23 09:27:08 CST 2007


http://bugs.winehq.org/show_bug.cgi?id=10549

           Summary: GetKeyNameText returns different text from Windows
           Product: Wine
           Version: 0.9.46.
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P2
         Component: wine-misc
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: djq at kerridge.com


In our app we generate accelerator text using the virtual key code of the
accelerator key and a couple of shift flags. e.g. a menu item's text would say
something like 'Do Stuff CTRL+D'

Under Wine for certain keys which appear both on the left and right of the
keyboard, in this case Alt, Shift and Ctrl. The text returned is specific to
the left/right scan code. This differs from Windows.

So our menu item will read something like 'Do Stuff Control_L+D' which is a
little ugly and implies you have to use the left Ctrl key.

Code snippet:

TCHAR   szText[64];
LONG    lParam;

// MapVirtualKey returns the scan code for the left control key.
// Left shift for the call to GetKeyNameText
lParam = MapVirtualKey(VK_CONTROL, 0) << 16;

// The string returned by GetKeyNameText on Windows does not differentiate
// between right and left and is 'CTRL' or 'Ctrl' depending on the Windows
Version
// Under Wine it returns 'Control_L'
GetKeyNameText(lParam, szText, sizeof(szText)/sizeof(szText[0]));


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list