Recent

Author Topic: Component to manage shortcuts?  (Read 411 times)

EganSolo

  • Sr. Member
  • ****
  • Posts: 334
Component to manage shortcuts?
« on: June 18, 2025, 10:14:04 pm »
I'm looking for a component that can:
  • Collect all shortcuts used by an application
  • Present them in a form that lets a user manage them

Short of that, how do I find which shortcuts are used in my app, and what would be the best strategy to manage them?

Thanks for any thoughts and feedback.

lainz

  • Hero Member
  • *****
  • Posts: 4725
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Component to manage shortcuts?
« Reply #1 on: June 18, 2025, 10:20:41 pm »
Here a sample of a thing you can do, use an ActionList and use these shortcuts...

Code: Pascal  [Select][+][-]
  1. for i:=0 to frmMain.ActionList.ActionCount-1 do
  2. var
  3.   sl: TStringList;
  4.  
  5. ......
  6.  
  7.       act := TAction(frmMain.ActionList.Actions[i]);
  8.         s := ShortCutToText(act.ShortCut);
  9.           if act.Visible then
  10.             sl.Add(s + ': ' + act.Hint)
  11.           else
  12.             sl.Add(s + ': Inactive [' + act.Hint + ']');
  13.  
  14. ......
  15.  

EganSolo

  • Sr. Member
  • ****
  • Posts: 334
Re: Component to manage shortcuts?
« Reply #2 on: June 19, 2025, 12:36:36 am »
Thanks lainz!That's very helpful.
Do you know if lifting the IDE's form that grabs the key combo is easy? I'd love to reuse it instead of creating my own from scratch... (see attachment)

 

TinyPortal © 2005-2018