CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2017

    Keyboard input and TranslateMessage

    As the doc ( about the windows keyboard input says

    Key strokes are converted into characters by the TranslateMessage function
    My question is how doues the `TranslateMessage` function really works in the hood. How does it translate the key-down messages (`WM_KEYDOWN, WM_SYSKEYDOWN`) to character massage (`WM_CHAR, WM_SYSCHAR`)?

    To clear up what i'm talking about here is the use case: when i set the keyboard layout to Polish when i press the `ALT key + a` i get the `ą` letter then when i change the layout to Turkey for e.g. a get the `` letter with different charcode then `ą` letter with Polish layout. How does the `TranslateMessage` utilize the current keyboard layout to produce differet charcodes for differet layouts? Does it use some kind of language tables/files/dlls to lookup the right charcode for selected layout?

  2. #2
    Join Date
    Nov 2000
    Voronezh, Russia

    Re: Keyboard input and TranslateMessage

    Hardly you can find information here more than MSDN provides. Definitely keyboard driver, localization tables and Windows core are involved in keypress translation, but this sort of information looks like belonging strictly with Windows core development, thus kept unexposed. You might find some crumbs in blogs of Windows veterans, but this place is not of the kind.
    Best regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width