Gtk2: do not report syskey for AltGr+Shift+Key for TCustomControl.Fixes issues #22703,#25874

git-svn-id: trunk@44507 -
This commit is contained in:
zeljko 2014-03-24 15:35:22 +00:00
parent 202388270c
commit 2a1f15b8f5

View File

@ -2298,26 +2298,30 @@ begin
// ssAlt + a key pressed is always a syskey // ssAlt + a key pressed is always a syskey
// ssAltGr + a key is only a syskey when the key pressed has no levelshift or when ssHift is pressed to0 // ssAltGr + a key is only a syskey when the key pressed has no levelshift or when ssHift is pressed to0
SysKey := (ssAlt in ShiftState); SysKey := (ssAlt in ShiftState);
if not SysKey if not SysKey then
then begin begin
// Check ssAltGr // Check ssAltGr
if (KCInfo.Flags and KCINFO_FLAG_ALTGR) = 0 if (KCInfo.Flags and KCINFO_FLAG_ALTGR) = 0 then
then begin
// VKey has no levelshift char so AltGr is syskey // VKey has no levelshift char so AltGr is syskey
SysKey := ssAltGr in ShiftState; SysKey := ssAltGr in ShiftState
end else
else begin begin
// VKey has levelshift char so AltGr + Shift is syskey // VKey has levelshift char so AltGr + Shift is syskey.
SysKey := ShiftState * [ssShift, ssAltGr] = [ssShift, ssAltGr] SysKey := (ShiftState * [ssShift, ssAltGr] = [ssShift, ssAltGr]);
// This is not true for TCustomControl, issues 22703,25874.
if Assigned(LCLObject) and (LCLObject is TCustomControl) then
SysKey := False;
end; end;
end; end;
if SysKey
then Flags := Flags or KF_ALTDOWN; if SysKey then
Flags := Flags or KF_ALTDOWN;
CommonKeyData := KeyCode shl 16; // Not really scancode, but will do CommonKeyData := KeyCode shl 16; // Not really scancode, but will do
if AHandleDown if AHandleDown then
then begin begin
{$IFDEF VerboseKeyboard} {$IFDEF VerboseKeyboard}
DebugLn('[HandleGTKKeyUpDown] GDK_KEY_PRESS VKey=',dbgs(VKey),' SysKey=',dbgs(SysKey)); DebugLn('[HandleGTKKeyUpDown] GDK_KEY_PRESS VKey=',dbgs(VKey),' SysKey=',dbgs(SysKey));
{$ENDIF} {$ENDIF}