[ros-dev] Explanation needed on TryToTranslateChar...

Johannes Olofsson johannes_olofsson at spray.se
Thu Mar 10 18:29:29 CET 2005


Hi!
Could somebody help me out and explain how the TryToTranslateChar function in \reactos\subsys\win32k\ntuser\keyboard.c is supposed to work...

First there is the following definition:
shift = keyLayout->pCharModifiers->ModNumber[ModBits];

which is later used in:
CapsMod = shift | ((CapsState & CAPITAL_BIT) ? vkPtr->Attributes : 0);

which is used for the translation:
*pwcTranslatedChar = vkPtr->wch[CapsMod];

Doesn't shift contain the index for the VK_TO_CHARSx table in the keyboard layout data structure?

Why is it then |:ed with vkPtr->Attributes , which I suppose corresponds to the CAPS/NOCAPS constants in the keyboard layout files ?

Shouldn't it be something like:
shift = keyLayout->pCharModifiers->ModNumber[ModBits ^ ((CapsState & CAPITAL_BIT) ? vkPtr->Attributes : 0];

Regards
Johannes Olofsson

10 Gigabyte Mailbox - http://mail.spray.se



More information about the Ros-dev mailing list