mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 18:58:04 +02:00
Merged revision(s) 59393 #a14d6e5c9a (required for cocoa merges) from trunk:
LCL: Change constant $20000000 to MK_ALT. Issue #34481, patch from AlexeyT. ........ git-svn-id: branches/fixes_2_0@61638 -
This commit is contained in:
parent
c88691c16e
commit
9aef764890
@ -329,7 +329,7 @@ begin
|
||||
VK_SCROLL : Result := MK_SCRLOCK;
|
||||
VK_SHIFT : Result := MK_SHIFTKEY;
|
||||
VK_CONTROL : Result := MK_COMMAND;
|
||||
VK_MENU : Result := MK_ALT;
|
||||
VK_MENU : Result := CarbonProc.MK_ALT; // see LCLType.MK_ALT
|
||||
VK_OEM_3 : Result := MK_TILDE;
|
||||
//VK_OEM_MINUS : Result := MK_MINUS;
|
||||
VK_OEM_PLUS : Result := MK_EQUAL;
|
||||
@ -482,7 +482,7 @@ begin
|
||||
if (ButtonState and 4) > 0 then Inc(Result, MK_MButton);
|
||||
if (shiftKey and Modifiers) > 0 then Inc(Result, MK_Shift);
|
||||
if (controlKey and Modifiers) > 0 then Inc(Result, MK_Control);
|
||||
if (optionKey and Modifiers) > 0 then Inc(Result, $20000000);
|
||||
if (optionKey and Modifiers) > 0 then Inc(Result, LCLType.MK_ALT); // see CarbonProc.MK_ALT
|
||||
|
||||
//DebugLn('GetCarbonMsgKeyState Result=',dbgs(KeysToShiftState(Result)),' Modifiers=',hexstr(Modifiers,8),' ButtonState=',hexstr(ButtonState,8));
|
||||
end;
|
||||
|
@ -846,7 +846,7 @@ begin
|
||||
VK_SCROLL : Result := MK_SCRLOCK;
|
||||
VK_SHIFT : Result := MK_SHIFTKEY;
|
||||
VK_CONTROL : Result := MK_COMMAND;
|
||||
VK_MENU : Result := MK_ALT;
|
||||
VK_MENU : Result := CocoaUtils.MK_ALT; // LCLType.MK_ALT exists
|
||||
VK_OEM_3 : Result := MK_TILDE;
|
||||
VK_OEM_MINUS : Result := MK_MINUS;
|
||||
VK_OEM_PLUS : Result := MK_EQUAL;
|
||||
|
@ -254,7 +254,7 @@ begin
|
||||
if AModifiers and NSControlKeyMask <> 0 then
|
||||
Result := Result or MK_CONTROL;
|
||||
if AModifiers and NSAlternateKeyMask <> 0 then
|
||||
Result := Result or $20000000;
|
||||
Result := Result or LCLType.MK_ALT; // see CocoaUtils.MK_ALT
|
||||
end;
|
||||
|
||||
class function TLCLCommonCallback.CocoaPressedMouseButtonsToKeyState(AMouseButtons: NSUInteger): PtrInt;
|
||||
@ -490,7 +490,8 @@ var
|
||||
IsSysKey := (Event.modifierFlags and NSCommandKeyMask) <> 0;
|
||||
KeyData := (Ord(Event.isARepeat) + 1) or Event.keyCode shl 16;
|
||||
if (Event.modifierFlags and NSAlternateKeyMask) <> 0 then
|
||||
KeyData := KeyData or $20000000; // So that MsgKeyDataToShiftState recognizes Alt key, see bug 30129
|
||||
KeyData := KeyData or LCLType.MK_ALT; // So that MsgKeyDataToShiftState recognizes Alt key, see bug 30129
|
||||
// see CocoaUtils.MK_ALT
|
||||
KeyCode := Event.keyCode;
|
||||
|
||||
//non-printable keys (see mackeycodes.inc)
|
||||
@ -861,7 +862,8 @@ begin
|
||||
IsSysKey := (Event.modifierFlags and NSCommandKeyMask) <> 0;
|
||||
KeyData := (Ord(Event.isARepeat) + 1) or Event.keyCode shl 16;
|
||||
if (Event.modifierFlags and NSAlternateKeyMask) <> 0 then
|
||||
KeyData := KeyData or $20000000; // So that MsgKeyDataToShiftState recognizes Alt key, see bug 30129
|
||||
KeyData := KeyData or LCLType.MK_ALT; // So that MsgKeyDataToShiftState recognizes Alt key, see bug 30129
|
||||
// see CocoaUtils.MK_ALT
|
||||
KeyCode := Event.keyCode;
|
||||
|
||||
ignModChr := Event.charactersIgnoringModifiers;
|
||||
|
@ -1494,7 +1494,7 @@ begin
|
||||
if AIsKeyEvent then
|
||||
Result := Result or KF_ALTDOWN
|
||||
else
|
||||
Result := Result or $20000000;
|
||||
Result := Result or MK_ALT;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1581,7 +1581,7 @@ begin
|
||||
ShiftState := ShiftState + [ssShift];
|
||||
if AState and MK_CONTROL <> 0 then
|
||||
ShiftState := ShiftState + [ssCtrl];
|
||||
if AState and $20000000 <> 0 then
|
||||
if AState and MK_ALT <> 0 then
|
||||
ShiftState := ShiftState + [ssAlt];
|
||||
// MappedXY := TranslateGdkPointToClientArea(AEvent^.scroll.window, EventXY,
|
||||
// {%H-}TGtk3Widget(AWinControl.Handle).GetContainerWidget);
|
||||
|
@ -1574,9 +1574,9 @@ function KeyboardShiftState(State: Word): PtrInt;
|
||||
begin
|
||||
Result := 0;
|
||||
if State and IEQUALIFIER_LALT <> 0 then
|
||||
Result := Result or $20000000;
|
||||
Result := Result or MK_ALT;
|
||||
//if State and IEQUALIFIER_RALT <> 0 then
|
||||
// Result := Result or $20000000;
|
||||
// Result := Result or MK_ALT;
|
||||
//writeln('ShiftState AROS: ', HexStr(Pointer(State)), ' and ', HexStr(Pointer(IEQUALIFIER_LALT)),' -> ', HexStr(Pointer(Result)));
|
||||
end;
|
||||
|
||||
|
@ -3820,7 +3820,7 @@ begin
|
||||
if AIsKeyEvent then
|
||||
Result := Result or KF_ALTDOWN
|
||||
else
|
||||
Result := Result or $20000000;
|
||||
Result := Result or MK_ALT;
|
||||
end;
|
||||
// $20000000;
|
||||
{ TODO: add support for ALT, META and NUMKEYPAD }
|
||||
@ -3967,7 +3967,7 @@ begin
|
||||
Msg.State := [ssShift];
|
||||
if (ModifierState and MK_CONTROL) <> 0 then
|
||||
Msg.State := [ssCtrl] + Msg.State;
|
||||
if (ModifierState and $20000000) <> 0 then
|
||||
if (ModifierState and MK_ALT) <> 0 then
|
||||
Msg.State := [ssAlt] + Msg.State;
|
||||
|
||||
LastMouse.WinControl := LCLObject;
|
||||
|
@ -3747,7 +3747,7 @@ begin
|
||||
if AIsKeyEvent then
|
||||
Result := Result or KF_ALTDOWN
|
||||
else
|
||||
Result := Result or $20000000;
|
||||
Result := Result or MK_ALT;
|
||||
end;
|
||||
// $20000000;
|
||||
{ TODO: add support for ALT, META and NUMKEYPAD }
|
||||
@ -3895,7 +3895,7 @@ begin
|
||||
Msg.State := [ssShift];
|
||||
if (ModifierState and MK_CONTROL) <> 0 then
|
||||
Msg.State := [ssCtrl] + Msg.State;
|
||||
if (ModifierState and $20000000) <> 0 then
|
||||
if (ModifierState and MK_ALT) <> 0 then
|
||||
Msg.State := [ssAlt] + Msg.State;
|
||||
|
||||
LastMouse.WinControl := LCLObject;
|
||||
|
@ -201,7 +201,7 @@ begin
|
||||
if GetKeyState(VK_SHIFT) < 0 then Include(Result, ssShift);
|
||||
if GetKeyState(VK_CONTROL) < 0 then Include(Result, ssCtrl);
|
||||
if GetKeyState(VK_LWIN) < 0 then Include(Result, ssMeta);
|
||||
if KeyData and $20000000 <> 0 then Include(Result, ssAlt);
|
||||
if KeyData and MK_ALT <> 0 then Include(Result, ssAlt);
|
||||
end;
|
||||
|
||||
{$I winapi.inc}
|
||||
|
@ -2835,6 +2835,7 @@ const
|
||||
MK_DOUBLECLICK = $80;
|
||||
MK_TRIPLECLICK = $100;
|
||||
MK_QUADCLICK = $200;
|
||||
MK_ALT = $20000000;
|
||||
|
||||
//==============================================
|
||||
// Constants from commctrl
|
||||
|
Loading…
Reference in New Issue
Block a user