From 8e77a5779a992f970b2a8f59caa0980b2c7f4af2 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Wed, 2 Sep 2026 17:54:26 +1000 Subject: [PATCH] fix(windows): CompileForBaseKeyboard doesn't return a value --- .../desktop/kmshell/main/UfrmBaseKeyboard.pas | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/windows/src/desktop/kmshell/main/UfrmBaseKeyboard.pas b/windows/src/desktop/kmshell/main/UfrmBaseKeyboard.pas index e9ce67d5e3..1f136871e6 100644 --- a/windows/src/desktop/kmshell/main/UfrmBaseKeyboard.pas +++ b/windows/src/desktop/kmshell/main/UfrmBaseKeyboard.pas @@ -21,7 +21,7 @@ type function ConfigureBaseKeyboard(out BaseKeyboardID: Integer): Boolean; function SetBaseKeyboard(WindowHandle: THandle; BaseKeyboardID: Integer): Boolean; function MCompileBaseKeyboard(const BaseKeyboardIDText: string): Boolean; -function CompileForBaseKeyboard(BaseKeyboardID: Integer): Boolean; +procedure CompileForBaseKeyboard(BaseKeyboardID: Integer); implementation @@ -84,7 +84,9 @@ begin if not TryStrToInt('$' + BaseKeyboardIDText, BaseKeyboardID) or not kmcom.SystemInfo.IsAdministrator then Exit; - Result := CompileForBaseKeyboard(BaseKeyboardID); + CompileForBaseKeyboard(BaseKeyboardID); + // TODO: sort out whether we need todo return a result + Result := True; end; function BaseKeyboardNeedsMCompile(BaseKeyboardID: Integer): Boolean; @@ -108,29 +110,24 @@ begin end; function SetBaseKeyboard(WindowHandle: THandle; BaseKeyboardID: Integer): Boolean; -var - MCompileResult: Boolean; begin - MCompileResult := True; Result := False; if BaseKeyboardNeedsMCompile(BaseKeyboardID) then begin if not kmcom.SystemInfo.IsAdministrator then begin - MCompileResult := WaitForElevatedConfiguration(WindowHandle, '-mcompilekbds ' + IntToHex(BaseKeyboardID, 8)) = 0; + WaitForElevatedConfiguration(WindowHandle, '-mcompilekbds ' + IntToHex(BaseKeyboardID, 8)); end else - MCompileResult := CompileForBaseKeyboard(BaseKeyboardID); + CompileForBaseKeyboard(BaseKeyboardID); end; - if not MCompileResult then - Exit; kmcom.Options['koBaseLayout'].Value := BaseKeyboardID; kmcom.Options.Apply; Result := True; end; -function CompileForBaseKeyboard(BaseKeyboardID: Integer): Boolean; +procedure CompileForBaseKeyboard(BaseKeyboardID: Integer); var i: Integer; kbd: IKeymanKeyboardInstalled;