How can i read the shortcut code? lazarus / 21-General ---------------------------------------------------------------------- zeljkoc · 2022-12-25 10:49 How can i read the shortcut code? Button1: TButton Button1.Captina := '&abort'; ShortCut code is 65 which function reads it &a = 65 ---------------------------------------------------------------------- Bart · 2022-12-25 12:04 For a text like '&abc' the shorcut will be the ordinal value of the uppercase of the 'a' character: 65. Bart ---------------------------------------------------------------------- zeljkoc · 2022-12-25 12:42 Which function reads it a: word; a:= ???? ---------------------------------------------------------------------- jamie · 2022-12-25 12:48 Short cut strings work in the Menus, and those are mostly done via the OS when accelerator keys are used.  Things like the THotKey maybe of interest ? ---------------------------------------------------------------------- zeljkoc · 2022-12-25 12:50 How can i get this or i have to make a function a := ?????('&abort'); ---------------------------------------------------------------------- zeljkoc · 2022-12-25 13:25 this feature solves my problem function StrToCharCode(aCode: String): Word; begin    if pos('&', aCode) <> 0 then      Result := ord( UpperCase(copy(aCode, pos('&', aCode)+1, 1))[1] )    else Result := -1; end; ---------------------------------------------------------------------- Thaddy · 2022-12-25 15:03 Then mark the header of the subject as [solved] ---------------------------------------------------------------------- ASerge · 2022-12-25 15:39 Quote from: zeljkoc on December 25, 2022, 02:25:24 pmthis feature solves my problem A slightly more correct function Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function ExtractHotCharCode(const S: string): SizeInt;var  PrefixPos: SizeInt;  SUpper: string;begin  SUpper := UpperCase(S);  PrefixPos := Pos(cHotkeyPrefix, SUpper);  if (PrefixPos = 0) or (PrefixPos = Length(SUpper)) then    Exit(-1);  Result := Ord(SUpper[PrefixPos + 1]);end; ---------------------------------------------------------------------- zeljkoc · 2022-12-25 18:00 Thanks ASerge, with the change it works fine. ? S         aCode   SUpper := UpperCase(S); ? cHotkeyPrefix     '&'  PrefixPos := Pos(cHotkeyPrefix, SUpper); function StrToCharCode(aCode: String): Word; var   PrefixPos: SizeInt;   SUpper: string; begin   SUpper := UpperCase(aCode);   PrefixPos := Pos('&', SUpper);   if (PrefixPos = 0) or (PrefixPos = Length(SUpper)) then     Exit(-1);   Result := Ord(SUpper[PrefixPos + 1]); end;