mirror of
https://github.com/paleotronic/microm8-gui.git
synced 2024-06-08 16:29:33 +00:00
fix key map open apple
This commit is contained in:
parent
9e254d7273
commit
7dd9d908a6
|
@ -821,9 +821,9 @@ begin
|
||||||
RepaintWindow;
|
RepaintWindow;
|
||||||
HideM8;
|
HideM8;
|
||||||
reply := Application.MessageBox('Reboot the VM?', 'Reboot', MB_ICONQUESTION + MB_YESNO );
|
reply := Application.MessageBox('Reboot the VM?', 'Reboot', MB_ICONQUESTION + MB_YESNO );
|
||||||
|
ShowM8;
|
||||||
if reply = idYes then
|
if reply = idYes then
|
||||||
SimpleGet(baseUrl + '/api/control/system/reboot');
|
SimpleGet(baseUrl + '/api/control/system/reboot');
|
||||||
ShowM8;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
@ -2796,6 +2796,8 @@ const
|
||||||
PAGE_DOWN = $e005;
|
PAGE_DOWN = $e005;
|
||||||
SHIFT_CSR_LEFT = $e05b;
|
SHIFT_CSR_LEFT = $e05b;
|
||||||
SHIFT_CSR_RIGHT = $e05c;
|
SHIFT_CSR_RIGHT = $e05c;
|
||||||
|
OPEN_APPLE = $e05d;
|
||||||
|
CLOSE_APPLE = $e05e;
|
||||||
var
|
var
|
||||||
isShift: boolean;
|
isShift: boolean;
|
||||||
isCtrl: boolean;
|
isCtrl: boolean;
|
||||||
|
@ -2806,6 +2808,12 @@ begin
|
||||||
isCtrl := (ssCtrl in Shift);
|
isCtrl := (ssCtrl in Shift);
|
||||||
isAlt := (ssAlt in Shift);
|
isAlt := (ssAlt in Shift);
|
||||||
|
|
||||||
|
if isAlt then
|
||||||
|
begin
|
||||||
|
result := OPEN_APPLE;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
case Key of
|
case Key of
|
||||||
219:
|
219:
|
||||||
if (isShift and not isCtrl) then
|
if (isShift and not isCtrl) then
|
||||||
|
@ -2944,7 +2952,8 @@ var
|
||||||
code: integer;
|
code: integer;
|
||||||
begin
|
begin
|
||||||
code := MapKeyCode(Key,Shift);
|
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);
|
StatusBar1.SimpleText := 'keycode = '+IntToStr(code);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2954,8 +2963,12 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGUIForm.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure TGUIForm.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
|
var
|
||||||
|
code: integer;
|
||||||
begin
|
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);
|
//StatusBar1.SimpleText := 'keycode ' + IntToStr(Key);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
12
main.pas
12
main.pas
|
@ -821,9 +821,9 @@ begin
|
||||||
RepaintWindow;
|
RepaintWindow;
|
||||||
HideM8;
|
HideM8;
|
||||||
reply := Application.MessageBox('Reboot the VM?', 'Reboot', MB_ICONQUESTION + MB_YESNO );
|
reply := Application.MessageBox('Reboot the VM?', 'Reboot', MB_ICONQUESTION + MB_YESNO );
|
||||||
|
ShowM8;
|
||||||
if reply = idYes then
|
if reply = idYes then
|
||||||
SimpleGet(baseUrl + '/api/control/system/reboot');
|
SimpleGet(baseUrl + '/api/control/system/reboot');
|
||||||
ShowM8;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
@ -2796,6 +2796,8 @@ const
|
||||||
PAGE_DOWN = $e005;
|
PAGE_DOWN = $e005;
|
||||||
SHIFT_CSR_LEFT = $e05b;
|
SHIFT_CSR_LEFT = $e05b;
|
||||||
SHIFT_CSR_RIGHT = $e05c;
|
SHIFT_CSR_RIGHT = $e05c;
|
||||||
|
OPEN_APPLE = $e05d;
|
||||||
|
CLOSE_APPLE = $e05e;
|
||||||
var
|
var
|
||||||
isShift: boolean;
|
isShift: boolean;
|
||||||
isCtrl: boolean;
|
isCtrl: boolean;
|
||||||
|
@ -2806,6 +2808,12 @@ begin
|
||||||
isCtrl := (ssCtrl in Shift);
|
isCtrl := (ssCtrl in Shift);
|
||||||
isAlt := (ssAlt in Shift);
|
isAlt := (ssAlt in Shift);
|
||||||
|
|
||||||
|
if isAlt then
|
||||||
|
begin
|
||||||
|
result := OPEN_APPLE;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
case Key of
|
case Key of
|
||||||
219:
|
219:
|
||||||
if (isShift and not isCtrl) then
|
if (isShift and not isCtrl) then
|
||||||
|
@ -2946,7 +2954,7 @@ begin
|
||||||
code := MapKeyCode(Key,Shift);
|
code := MapKeyCode(Key,Shift);
|
||||||
if code <> 0 then
|
if code <> 0 then
|
||||||
SendKey( code, 0, 1, MapShiftState(Key, Shift) );
|
SendKey( code, 0, 1, MapShiftState(Key, Shift) );
|
||||||
StatusBar1.SimpleText := 'keycode = '+IntToStr(code);
|
//StatusBar1.SimpleText := 'keycode = '+IntToStr(code);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGUIForm.FormKeyPress(Sender: TObject; var Key: char);
|
procedure TGUIForm.FormKeyPress(Sender: TObject; var Key: char);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user