fix(windows): apply batched suggestions from code review

Co-authored-by: Marc Durdin <marc@durdin.net>
This commit is contained in:
rc-swag 2026-09-18 20:48:56 +10:00 • committed by GitHub
parent c940caeb71
commit 587d74dee4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 11 deletions

View file

@ -62,21 +62,21 @@ function WideQuotedStr(const str: WideString): WideString; deprecated; // I3310
* Creates the compiled keyboard filename by inserting the base keyboard ID
* before the .kmx extension.
*
* @param KeyboardFileName Keyboard filename, in the form keyboardname.kmx.
* @param BaseKeyboardIDHex Base keyboard ID in hexadecimal form.
* @return Compiled keyboard filename, in the form keyboardname-<KLID>.kmx.
* @param KeyboardFileName Keyboard filename, in the form '[path\]keyboardid[.kmx]'
* @param BaseKeyboardIDHex Base keyboard KLID in eight digit hexadecimal form
* @return Compiled keyboard filename, in the form '[path\]keyboardid-<KLID>.kmx'
*)
function InsertBKLIDFilename(const KeyboardFileName: string; BaseKeyboardIDHex: string): string;
function GetKeyboardFilenameWithBaseKeyboardID(const KeyboardFileName: string; BaseKeyboardIDHex: string): string;
(**
* Creates the dead-key compiled keyboard filename by inserting the base
* keyboard ID and -d suffix before the .kmx extension.
*
* @param KeyboardFileName Keyboard filename, in the form keyboardname.kmx.
* @param BaseKeyboardIDHex Base keyboard ID in hexadecimal form.
* @return Dead-key compiled keyboard filename, in the form keyboardname-<KLID>-d.kmx.
* @param KeyboardFileName Keyboard filename, in the form '[path]\keyboardid[.kmx]'
* @param BaseKeyboardIDHex Base keyboard KLID in eight digit hexadecimal form
* @return Dead-key compiled keyboard filename, in the form '[path\]keyboardid-<KLID>-d.kmx'
*)
function InsertBKLIDDeadkeyFilename(const KeyboardFileName: string; BaseKeyboardIDHex: string): string;
function GetKeyboardFilenameWithBaseKeyboardIDAndDeadkey(const KeyboardFileName: string; BaseKeyboardIDHex: string): string;
implementation
@ -436,14 +436,14 @@ begin
Result.Bottom := StrToIntDef(s, 0);
end;
function InsertBKLIDFilename(const KeyboardFileName: string; BaseKeyboardIDHex: string): string;
function GetKeyboardFilenameWithBaseKeyboardID(const KeyboardFileName: string; BaseKeyboardIDHex: string): string;
begin
Result := ChangeFileExt(KeyboardFileName, '') + '-' + BaseKeyboardIDHex + '.kmx';
end;
function InsertBKLIDDeadkeyFilename(const KeyboardFileName: string; BaseKeyboardIDHex: string): string;
function GetKeyboardFilenameWithBaseKeyboardIDAndDeadkey(const KeyboardFileName: string; BaseKeyboardIDHex: string): string;
begin
Result := ChangeFileExt(KeyboardFileName, '') + '-' + BaseKeyboardIDHex + '-d.kmx'
Result := ChangeFileExt(KeyboardFileName, '') + '-' + BaseKeyboardIDHex + '-d.kmx';
end;
end.

View file

@ -266,6 +266,7 @@ begin
else if s = '-basekeyboard' then FMode := fmBaseKeyboard // I4169
else if s = '-mcompilekbds' then
begin
// Requires elevated context
FMode := fmMCompileKbds;
Inc(i);
if i > ParamCount then Exit;