From 3953bb42fdb434399d5eac291f42062b09d3d801 Mon Sep 17 00:00:00 2001 From: April Ayres-Griffiths Date: Wed, 17 Apr 2019 19:12:35 +1000 Subject: [PATCH] key and window size fixes --- backup/main.lfm | 98 ++++++++++++++++++++++++------------------------- backup/main.pas | 21 +++++++++-- backup/poc.lps | 70 +++++++++++++++++------------------ main.lfm | 98 ++++++++++++++++++++++++------------------------- main.pas | 21 +++++++++-- poc.lps | 70 +++++++++++++++++------------------ 6 files changed, 202 insertions(+), 176 deletions(-) diff --git a/backup/main.lfm b/backup/main.lfm index 180cf88..f2b80ea 100644 --- a/backup/main.lfm +++ b/backup/main.lfm @@ -1,13 +1,13 @@ object GUIForm: TGUIForm - Left = 565 - Height = 668 - Top = 128 - Width = 1014 + Left = 320 + Height = 723 + Top = 76 + Width = 1113 AlphaBlendValue = 128 Caption = 'microM8 GUI' - ClientHeight = 643 - ClientWidth = 1014 - Constraints.MinWidth = 1014 + ClientHeight = 698 + ClientWidth = 1113 + Constraints.MinWidth = 1078 DoubleBuffered = False Menu = MainMenu1 OnChangeBounds = FormChangeBounds @@ -30,15 +30,15 @@ object GUIForm: TGUIForm object StatusBar1: TStatusBar Left = 0 Height = 19 - Top = 624 - Width = 1014 + Top = 679 + Width = 1113 Panels = <> end object ToolBar1: TToolBar Left = 0 Height = 36 Top = 0 - Width = 1014 + Width = 1113 ButtonHeight = 32 ButtonWidth = 32 Caption = 'ToolBar1' @@ -58,7 +58,7 @@ object GUIForm: TGUIForm end object tbRMVoxels: TToolButton Tag = 1 - Left = 549 + Left = 613 Hint = 'Voxel Render' Top = 2 Caption = 'Voxels' @@ -72,7 +72,7 @@ object GUIForm: TGUIForm Style = tbsCheck end object tbRMDots: TToolButton - Left = 585 + Left = 649 Hint = 'Dot Render' Top = 2 Caption = 'Dots' @@ -85,7 +85,7 @@ object GUIForm: TGUIForm end object tbRMRaster: TToolButton Tag = 2 - Left = 621 + Left = 685 Hint = 'Raster Render' Top = 2 Caption = 'Raster' @@ -97,7 +97,7 @@ object GUIForm: TGUIForm Style = tbsCheck end object tbRMColor: TToolButton - Left = 657 + Left = 721 Hint = 'Toggle Color/Mono' Top = 2 Caption = 'tbRMColor' @@ -107,7 +107,7 @@ object GUIForm: TGUIForm ShowHint = True end object tbRECState: TToolButton - Left = 725 + Left = 789 Hint = 'Start Recording' Top = 2 Caption = 'tbRECState' @@ -117,7 +117,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton5: TToolButton - Left = 761 + Left = 825 Hint = 'Rewind' Top = 2 Caption = 'ToolButton5' @@ -127,7 +127,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton6: TToolButton - Left = 797 + Left = 861 Hint = 'Forwards' Top = 2 Caption = 'ToolButton6' @@ -137,7 +137,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton7: TToolButton - Left = 833 + Left = 897 Hint = 'Resume' Top = 2 Caption = 'ToolButton7' @@ -147,7 +147,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton8: TToolButton - Left = 869 + Left = 933 Hint = 'Stop Recording' Top = 2 Caption = 'ToolButton8' @@ -157,7 +157,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton9: TToolButton - Left = 905 + Left = 969 Hint = 'Pause' Top = 2 Caption = 'ToolButton9' @@ -167,7 +167,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton10: TToolButton - Left = 693 + Left = 757 Top = 2 Caption = 'ToolButton10' Enabled = False @@ -234,7 +234,7 @@ object GUIForm: TGUIForm Left = 249 Height = 38 Top = 2 - Width = 64 + Width = 96 OnChange = tbMasterVolumeChange Position = 0 ScalePos = trBottom @@ -249,7 +249,7 @@ object GUIForm: TGUIForm TabOrder = 0 end object tbVolUp: TToolButton - Left = 313 + Left = 345 Hint = 'Volume Up' Top = 2 Caption = 'tbVolUp' @@ -259,13 +259,13 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton3: TToolButton - Left = 349 + Left = 381 Top = 2 Caption = 'ToolButton3' Enabled = False end object tbSpeedDown: TToolButton - Left = 381 + Left = 413 Hint = 'CPU Speed Down' Top = 2 Caption = 'tbSpeedDown' @@ -275,10 +275,10 @@ object GUIForm: TGUIForm ShowHint = True end object TrackBar2: TTrackBar - Left = 417 + Left = 449 Height = 38 Top = 2 - Width = 64 + Width = 96 Max = 4 OnChange = TrackBar2Change Position = 0 @@ -293,7 +293,7 @@ object GUIForm: TGUIForm TabOrder = 1 end object tbSpeedUp: TToolButton - Left = 481 + Left = 545 Hint = 'CPU Speed Up' Top = 2 Caption = 'tbSpeedUp' @@ -303,19 +303,19 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton18: TToolButton - Left = 517 + Left = 581 Top = 2 Caption = 'ToolButton18' Enabled = False end object ToolButton1: TToolButton - Left = 941 + Left = 1005 Top = 2 Caption = 'ToolButton1' Enabled = False end object tbFullscreen: TToolButton - Left = 973 + Left = 1037 Hint = 'Fullscreen' Top = 2 Caption = 'tbFullscreen' @@ -327,31 +327,31 @@ object GUIForm: TGUIForm end object pnlContainer: TPanel Left = 0 - Height = 588 + Height = 643 Top = 36 - Width = 1014 + Width = 1113 Align = alClient BevelOuter = bvNone - ClientHeight = 588 - ClientWidth = 1014 + ClientHeight = 643 + ClientWidth = 1113 ParentColor = False TabOrder = 2 object sidecarPanel: TPanel - Left = 844 - Height = 551 + Left = 943 + Height = 606 Top = 0 Width = 170 Align = alRight BevelOuter = bvNone Caption = 'sidecarPanel' - ClientHeight = 551 + ClientHeight = 606 ClientWidth = 170 Color = clBlack ParentColor = False TabOrder = 0 object Image1: TImage Left = 0 - Height = 551 + Height = 606 Top = 0 Width = 170 Align = alClient @@ -5444,13 +5444,13 @@ object GUIForm: TGUIForm end object embedPanel: TPanel Left = 0 - Height = 551 + Height = 606 Top = 0 - Width = 844 + Width = 943 Align = alClient BevelOuter = bvNone - ClientHeight = 551 - ClientWidth = 844 + ClientHeight = 606 + ClientWidth = 943 Color = clBlack Font.Color = clWhite ParentColor = False @@ -5461,9 +5461,9 @@ object GUIForm: TGUIForm OnMouseUp = FormMouseUp object backdrop: TImage Left = 0 - Height = 551 + Height = 606 Top = 0 - Width = 844 + Width = 943 Align = alClient OnClick = backdropClick OnMouseDown = FormMouseDown @@ -5474,11 +5474,11 @@ object GUIForm: TGUIForm object pnlMemory: TPanel Left = 0 Height = 37 - Top = 551 - Width = 1014 + Top = 606 + Width = 1113 Align = alBottom ClientHeight = 37 - ClientWidth = 1014 + ClientWidth = 1113 ParentColor = False TabOrder = 2 Visible = False @@ -5520,7 +5520,7 @@ object GUIForm: TGUIForm Text = '$00' end object pnlMemButtons: TPanel - Left = 760 + Left = 859 Height = 35 Top = 1 Width = 253 diff --git a/backup/main.pas b/backup/main.pas index 0e6cf32..e85a0e5 100644 --- a/backup/main.pas +++ b/backup/main.pas @@ -2870,13 +2870,26 @@ begin if isCaps then keydesc := 'CapsLock'; - if isAlt or isMeta then + if isAlt then begin result := OPEN_APPLE; + //exit; + end; + + if isMeta then + begin + result := 0; exit; end; case Key of + VK_BACK: + if isCtrl and isShift then + Result := 0; + 13: begin + if isAlt or isShift or isCtrl then + Result := 0; + end; VK_SHIFT: Result := 0; VK_CAPITAL: begin if KeyUp then @@ -3049,9 +3062,9 @@ procedure TGUIForm.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState) var code: integer; begin - code := MapKeyCode(Key,Shift,true); - if code <> 0 then - SendKey( code, 0, 0, MapShiftState(Key, Shift) ); + //code := MapKeyCode(Key,Shift,true); + //if code <> 0 then + // SendKey( code, 0, 0, MapShiftState(Key, Shift) ); //StatusBar1.SimpleText := 'keycode ' + IntToStr(Key); end; diff --git a/backup/poc.lps b/backup/poc.lps index 8128275..3094fbd 100644 --- a/backup/poc.lps +++ b/backup/poc.lps @@ -21,8 +21,8 @@ - - + + @@ -43,7 +43,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -61,129 +61,129 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/main.lfm b/main.lfm index 180cf88..c81e7de 100644 --- a/main.lfm +++ b/main.lfm @@ -1,13 +1,13 @@ object GUIForm: TGUIForm - Left = 565 - Height = 668 - Top = 128 - Width = 1014 + Left = 371 + Height = 683 + Top = 112 + Width = 1078 AlphaBlendValue = 128 Caption = 'microM8 GUI' - ClientHeight = 643 - ClientWidth = 1014 - Constraints.MinWidth = 1014 + ClientHeight = 658 + ClientWidth = 1078 + Constraints.MinWidth = 1078 DoubleBuffered = False Menu = MainMenu1 OnChangeBounds = FormChangeBounds @@ -30,15 +30,15 @@ object GUIForm: TGUIForm object StatusBar1: TStatusBar Left = 0 Height = 19 - Top = 624 - Width = 1014 + Top = 639 + Width = 1078 Panels = <> end object ToolBar1: TToolBar Left = 0 Height = 36 Top = 0 - Width = 1014 + Width = 1078 ButtonHeight = 32 ButtonWidth = 32 Caption = 'ToolBar1' @@ -58,7 +58,7 @@ object GUIForm: TGUIForm end object tbRMVoxels: TToolButton Tag = 1 - Left = 549 + Left = 613 Hint = 'Voxel Render' Top = 2 Caption = 'Voxels' @@ -72,7 +72,7 @@ object GUIForm: TGUIForm Style = tbsCheck end object tbRMDots: TToolButton - Left = 585 + Left = 649 Hint = 'Dot Render' Top = 2 Caption = 'Dots' @@ -85,7 +85,7 @@ object GUIForm: TGUIForm end object tbRMRaster: TToolButton Tag = 2 - Left = 621 + Left = 685 Hint = 'Raster Render' Top = 2 Caption = 'Raster' @@ -97,7 +97,7 @@ object GUIForm: TGUIForm Style = tbsCheck end object tbRMColor: TToolButton - Left = 657 + Left = 721 Hint = 'Toggle Color/Mono' Top = 2 Caption = 'tbRMColor' @@ -107,7 +107,7 @@ object GUIForm: TGUIForm ShowHint = True end object tbRECState: TToolButton - Left = 725 + Left = 789 Hint = 'Start Recording' Top = 2 Caption = 'tbRECState' @@ -117,7 +117,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton5: TToolButton - Left = 761 + Left = 825 Hint = 'Rewind' Top = 2 Caption = 'ToolButton5' @@ -127,7 +127,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton6: TToolButton - Left = 797 + Left = 861 Hint = 'Forwards' Top = 2 Caption = 'ToolButton6' @@ -137,7 +137,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton7: TToolButton - Left = 833 + Left = 897 Hint = 'Resume' Top = 2 Caption = 'ToolButton7' @@ -147,7 +147,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton8: TToolButton - Left = 869 + Left = 933 Hint = 'Stop Recording' Top = 2 Caption = 'ToolButton8' @@ -157,7 +157,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton9: TToolButton - Left = 905 + Left = 969 Hint = 'Pause' Top = 2 Caption = 'ToolButton9' @@ -167,7 +167,7 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton10: TToolButton - Left = 693 + Left = 757 Top = 2 Caption = 'ToolButton10' Enabled = False @@ -234,7 +234,7 @@ object GUIForm: TGUIForm Left = 249 Height = 38 Top = 2 - Width = 64 + Width = 96 OnChange = tbMasterVolumeChange Position = 0 ScalePos = trBottom @@ -249,7 +249,7 @@ object GUIForm: TGUIForm TabOrder = 0 end object tbVolUp: TToolButton - Left = 313 + Left = 345 Hint = 'Volume Up' Top = 2 Caption = 'tbVolUp' @@ -259,13 +259,13 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton3: TToolButton - Left = 349 + Left = 381 Top = 2 Caption = 'ToolButton3' Enabled = False end object tbSpeedDown: TToolButton - Left = 381 + Left = 413 Hint = 'CPU Speed Down' Top = 2 Caption = 'tbSpeedDown' @@ -275,10 +275,10 @@ object GUIForm: TGUIForm ShowHint = True end object TrackBar2: TTrackBar - Left = 417 + Left = 449 Height = 38 Top = 2 - Width = 64 + Width = 96 Max = 4 OnChange = TrackBar2Change Position = 0 @@ -293,7 +293,7 @@ object GUIForm: TGUIForm TabOrder = 1 end object tbSpeedUp: TToolButton - Left = 481 + Left = 545 Hint = 'CPU Speed Up' Top = 2 Caption = 'tbSpeedUp' @@ -303,19 +303,19 @@ object GUIForm: TGUIForm ShowHint = True end object ToolButton18: TToolButton - Left = 517 + Left = 581 Top = 2 Caption = 'ToolButton18' Enabled = False end object ToolButton1: TToolButton - Left = 941 + Left = 1005 Top = 2 Caption = 'ToolButton1' Enabled = False end object tbFullscreen: TToolButton - Left = 973 + Left = 1037 Hint = 'Fullscreen' Top = 2 Caption = 'tbFullscreen' @@ -327,31 +327,31 @@ object GUIForm: TGUIForm end object pnlContainer: TPanel Left = 0 - Height = 588 + Height = 603 Top = 36 - Width = 1014 + Width = 1078 Align = alClient BevelOuter = bvNone - ClientHeight = 588 - ClientWidth = 1014 + ClientHeight = 603 + ClientWidth = 1078 ParentColor = False TabOrder = 2 object sidecarPanel: TPanel - Left = 844 - Height = 551 + Left = 908 + Height = 566 Top = 0 Width = 170 Align = alRight BevelOuter = bvNone Caption = 'sidecarPanel' - ClientHeight = 551 + ClientHeight = 566 ClientWidth = 170 Color = clBlack ParentColor = False TabOrder = 0 object Image1: TImage Left = 0 - Height = 551 + Height = 566 Top = 0 Width = 170 Align = alClient @@ -5444,13 +5444,13 @@ object GUIForm: TGUIForm end object embedPanel: TPanel Left = 0 - Height = 551 + Height = 566 Top = 0 - Width = 844 + Width = 908 Align = alClient BevelOuter = bvNone - ClientHeight = 551 - ClientWidth = 844 + ClientHeight = 566 + ClientWidth = 908 Color = clBlack Font.Color = clWhite ParentColor = False @@ -5461,9 +5461,9 @@ object GUIForm: TGUIForm OnMouseUp = FormMouseUp object backdrop: TImage Left = 0 - Height = 551 + Height = 566 Top = 0 - Width = 844 + Width = 908 Align = alClient OnClick = backdropClick OnMouseDown = FormMouseDown @@ -5474,11 +5474,11 @@ object GUIForm: TGUIForm object pnlMemory: TPanel Left = 0 Height = 37 - Top = 551 - Width = 1014 + Top = 566 + Width = 1078 Align = alBottom ClientHeight = 37 - ClientWidth = 1014 + ClientWidth = 1078 ParentColor = False TabOrder = 2 Visible = False @@ -5520,7 +5520,7 @@ object GUIForm: TGUIForm Text = '$00' end object pnlMemButtons: TPanel - Left = 760 + Left = 824 Height = 35 Top = 1 Width = 253 diff --git a/main.pas b/main.pas index 87d03be..e85a0e5 100644 --- a/main.pas +++ b/main.pas @@ -2870,13 +2870,26 @@ begin if isCaps then keydesc := 'CapsLock'; - if isAlt or isMeta then + if isAlt then begin result := OPEN_APPLE; //exit; end; + if isMeta then + begin + result := 0; + exit; + end; + case Key of + VK_BACK: + if isCtrl and isShift then + Result := 0; + 13: begin + if isAlt or isShift or isCtrl then + Result := 0; + end; VK_SHIFT: Result := 0; VK_CAPITAL: begin if KeyUp then @@ -3049,9 +3062,9 @@ procedure TGUIForm.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState) var code: integer; begin - code := MapKeyCode(Key,Shift,true); - if code <> 0 then - SendKey( code, 0, 0, MapShiftState(Key, Shift) ); + //code := MapKeyCode(Key,Shift,true); + //if code <> 0 then + // SendKey( code, 0, 0, MapShiftState(Key, Shift) ); //StatusBar1.SimpleText := 'keycode ' + IntToStr(Key); end; diff --git a/poc.lps b/poc.lps index 1cd10c4..3094fbd 100644 --- a/poc.lps +++ b/poc.lps @@ -21,8 +21,8 @@ - - + + @@ -43,7 +43,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -61,129 +61,129 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +