* AltGr fixed

This commit is contained in:
florian 2005-01-07 18:59:22 +00:00
parent 2a698224ef
commit 35049973bf

View File

@ -57,7 +57,6 @@ var
{ used for keyboard specific stuff } { used for keyboard specific stuff }
KeyBoardLayout : HKL; KeyBoardLayout : HKL;
Inited : Boolean; Inited : Boolean;
hklold : HKL {$Ifndef ver1_0} = 0 {$endif}; // can be used to force kbd redetect.
HasAltGr : Boolean{$ifndef ver1_0} = false {$endif}; HasAltGr : Boolean{$ifndef ver1_0} = false {$endif};
@ -244,29 +243,25 @@ var ahkl : HKL;
i : integer; i : integer;
begin begin
HasAltGr:=FALSE; HasAltGr:=false;
ahkl:=GetKeyboardLayout(0); ahkl:=GetKeyboardLayout(0);
if (hklOld<>ahkl) then i:=$20;
Begin while i<$100 do
hklOld:=ahkl; begin
i:=$20; // <MSDN>
while i<$100 do // For keyboard layouts that use the right-hand ALT key as ashift key
begin // (for example, the French keyboard layout), the shift state is
// <MSDN> // represented by the value 6, because the right-hand ALT key is
// For keyboard layouts that use the right-hand ALT key as ashift key // converted internally into CTRL+ALT.
// (for example, the French keyboard layout), the shift state is // </MSDN>
// represented by the value 6, because the right-hand ALT key is if (HIBYTE(VkKeyScanEx(chr(i),ahkl))=6) then
// converted internally into CTRL+ALT. begin
// </MSDN> HasAltGr:=true;
if (HIBYTE(VkKeyScanEx(chr(i),ahkl))=6) then break;
begin
HasAltGr:=TRUE;
break;
end;
inc(i);
end; end;
end; inc(i);
end;
end; end;
@ -881,7 +876,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.11 2004-11-21 12:38:45 marco Revision 1.12 2005-01-07 18:59:22 florian
* AltGr fixed
Revision 1.11 2004/11/21 12:38:45 marco
* altgr handling now gets OS information. Works for default layout, not for manually (tray) changed layouts * altgr handling now gets OS information. Works for default layout, not for manually (tray) changed layouts
Revision 1.10 2003/10/27 15:28:07 peter Revision 1.10 2003/10/27 15:28:07 peter