fix key map open apple

This commit is contained in:
April Ayres-Griffiths 2019-04-15 22:51:14 +10:00
parent 9e254d7273
commit 7dd9d908a6
2 changed files with 26 additions and 5 deletions

View File

@ -821,9 +821,9 @@ begin
RepaintWindow;
HideM8;
reply := Application.MessageBox('Reboot the VM?', 'Reboot', MB_ICONQUESTION + MB_YESNO );
ShowM8;
if reply = idYes then
SimpleGet(baseUrl + '/api/control/system/reboot');
ShowM8;
end;
end;
@ -2796,6 +2796,8 @@ const
PAGE_DOWN = $e005;
SHIFT_CSR_LEFT = $e05b;
SHIFT_CSR_RIGHT = $e05c;
OPEN_APPLE = $e05d;
CLOSE_APPLE = $e05e;
var
isShift: boolean;
isCtrl: boolean;
@ -2806,6 +2808,12 @@ begin
isCtrl := (ssCtrl in Shift);
isAlt := (ssAlt in Shift);
if isAlt then
begin
result := OPEN_APPLE;
exit;
end;
case Key of
219:
if (isShift and not isCtrl) then
@ -2944,7 +2952,8 @@ var
code: integer;
begin
code := MapKeyCode(Key,Shift);
SendKey( code, 0, 1, MapShiftState(Key, Shift) );
if code <> 0 then
SendKey( code, 0, 1, MapShiftState(Key, Shift) );
StatusBar1.SimpleText := 'keycode = '+IntToStr(code);
end;
@ -2954,8 +2963,12 @@ begin
end;
procedure TGUIForm.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
var
code: integer;
begin
SendKey( MapKeyCode(Key, Shift), 0, 0, MapShiftState(Key, Shift) );
code := MapKeyCode(Key,Shift);
if code <> 0 then
SendKey( code, 0, 0, MapShiftState(Key, Shift) );
//StatusBar1.SimpleText := 'keycode ' + IntToStr(Key);
end;

View File

@ -821,9 +821,9 @@ begin
RepaintWindow;
HideM8;
reply := Application.MessageBox('Reboot the VM?', 'Reboot', MB_ICONQUESTION + MB_YESNO );
ShowM8;
if reply = idYes then
SimpleGet(baseUrl + '/api/control/system/reboot');
ShowM8;
end;
end;
@ -2796,6 +2796,8 @@ const
PAGE_DOWN = $e005;
SHIFT_CSR_LEFT = $e05b;
SHIFT_CSR_RIGHT = $e05c;
OPEN_APPLE = $e05d;
CLOSE_APPLE = $e05e;
var
isShift: boolean;
isCtrl: boolean;
@ -2806,6 +2808,12 @@ begin
isCtrl := (ssCtrl in Shift);
isAlt := (ssAlt in Shift);
if isAlt then
begin
result := OPEN_APPLE;
exit;
end;
case Key of
219:
if (isShift and not isCtrl) then
@ -2946,7 +2954,7 @@ begin
code := MapKeyCode(Key,Shift);
if code <> 0 then
SendKey( code, 0, 1, MapShiftState(Key, Shift) );
StatusBar1.SimpleText := 'keycode = '+IntToStr(code);
//StatusBar1.SimpleText := 'keycode = '+IntToStr(code);
end;
procedure TGUIForm.FormKeyPress(Sender: TObject; var Key: char);