mirror of
https://github.com/reactos/reactos.git
synced 2024-09-15 23:28:15 +00:00
Caps Lock fix suggested by Johannes Olofsson. We now xor the caps lock
attribute bit with the mod bits before turning them into a column number. svn path=/trunk/; revision=13918
This commit is contained in:
parent
2517dde027
commit
f68df768b9
|
@ -216,7 +216,7 @@ static BOOL TryToTranslateChar(WORD wVirtKey,
|
||||||
PVK_TO_WCHAR_TABLE vtwTbl;
|
PVK_TO_WCHAR_TABLE vtwTbl;
|
||||||
PVK_TO_WCHARS10 vkPtr;
|
PVK_TO_WCHARS10 vkPtr;
|
||||||
size_t size_this_entry;
|
size_t size_this_entry;
|
||||||
int nMod, shift;
|
int nMod;
|
||||||
DWORD CapsMod = 0, CapsState = 0;
|
DWORD CapsMod = 0, CapsState = 0;
|
||||||
|
|
||||||
CapsState = ModBits & ~MOD_BITS_MASK;
|
CapsState = ModBits & ~MOD_BITS_MASK;
|
||||||
|
@ -228,8 +228,6 @@ static BOOL TryToTranslateChar(WORD wVirtKey,
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
shift = keyLayout->pCharModifiers->ModNumber[ModBits];
|
|
||||||
|
|
||||||
for (nMod = 0; keyLayout->pVkToWcharTable[nMod].nModifications; nMod++)
|
for (nMod = 0; keyLayout->pVkToWcharTable[nMod].nModifications; nMod++)
|
||||||
{
|
{
|
||||||
vtwTbl = &keyLayout->pVkToWcharTable[nMod];
|
vtwTbl = &keyLayout->pVkToWcharTable[nMod];
|
||||||
|
@ -239,8 +237,9 @@ static BOOL TryToTranslateChar(WORD wVirtKey,
|
||||||
{
|
{
|
||||||
if( wVirtKey == (vkPtr->VirtualKey & 0xff) )
|
if( wVirtKey == (vkPtr->VirtualKey & 0xff) )
|
||||||
{
|
{
|
||||||
CapsMod =
|
CapsMod = keyLayout->pCharModifiers->ModNumber
|
||||||
shift | ((CapsState & CAPITAL_BIT) ? vkPtr->Attributes : 0);
|
[ModBits ^
|
||||||
|
((CapsState & CAPITAL_BIT) ? vkPtr->Attributes : 0)];
|
||||||
|
|
||||||
if( CapsMod > keyLayout->pVkToWcharTable[nMod].nModifications ) {
|
if( CapsMod > keyLayout->pVkToWcharTable[nMod].nModifications ) {
|
||||||
DWORD MaxBit = 1;
|
DWORD MaxBit = 1;
|
||||||
|
@ -256,9 +255,9 @@ static BOOL TryToTranslateChar(WORD wVirtKey,
|
||||||
*pbLigature = vkPtr->wch[CapsMod] == WCH_LGTR;
|
*pbLigature = vkPtr->wch[CapsMod] == WCH_LGTR;
|
||||||
*pwcTranslatedChar = vkPtr->wch[CapsMod];
|
*pwcTranslatedChar = vkPtr->wch[CapsMod];
|
||||||
|
|
||||||
DPRINT("%d %04x: CapsMod %08x CapsState %08x shift %08x Char %04x\n",
|
DPRINT("%d %04x: CapsMod %08x CapsState %08x Char %04x\n",
|
||||||
nMod, wVirtKey,
|
nMod, wVirtKey,
|
||||||
CapsMod, CapsState, shift, *pwcTranslatedChar);
|
CapsMod, CapsState, *pwcTranslatedChar);
|
||||||
|
|
||||||
if( *pbDead )
|
if( *pbDead )
|
||||||
{
|
{
|
||||||
|
@ -269,7 +268,7 @@ static BOOL TryToTranslateChar(WORD wVirtKey,
|
||||||
DPRINT( "VK: %04x, ADDR: %08x\n", wVirtKey, (int)vkPtr );
|
DPRINT( "VK: %04x, ADDR: %08x\n", wVirtKey, (int)vkPtr );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
*pwcTranslatedChar = vkPtr->wch[shift];
|
*pwcTranslatedChar = vkPtr->wch[CapsMod];
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue