Board index » delphi » CL - Hotkey

CL - Hotkey

I want my users to have help under F1 at any position in the app without
having to add HelpID / numbers to all objects.
Ho do I do that ?
Is there an application.hotkey or something like that ?

Kees Lagendijk

 

Re:CL - Hotkey


I want my users to have help under F1 at any position in the app without
having to add HelpID / numbers to all objects.
Ho do I do that ?
Is there an application.hotkey or something like that ?

Kees Lagendijk

Re:CL - Hotkey


One way around this is the following

  Use the Application.OnMessage event and include a filter for key events
and then filter those for f1 key presses and then in the resulting code
launch your application's help routine.

Re:CL - Hotkey


I want my users to have help under F1 at any position in the app without
having to add HelpID / numbers to all objects.
Ho do I do that ?
Is there an application.hotkey or something like that ?

Kees Lagendijk

Re:CL - Hotkey


  To show the help file, all you have to do is turn on key preview and then
'OnKeyPress' do 'if key = VK_F1 then...' --  And then execute the help file...

--
Jason Wallace
SL Software
Dark...@SLSoftware.reno.nv.us
--
"We are Microsoft.  You will be assimilated.  Resistance is Futile."
--

Quote
Kees Lagendijk wrote in message <719fhf$g0...@sun4000.casema.net>...
>I want my users to have help under F1 at any position in the app without
>having to add HelpID / numbers to all objects.
>Ho do I do that ?
>Is there an application.hotkey or something like that ?

>Kees Lagendijk

Re:CL - Hotkey


Hi,

You can use my component THotKeyWrapper. It encapsulates the
RegisterHotKey and UnregisterHotKey functions. It has an OnHotKey event
that you can use to trap all hotkeys (there could be any number of
hotkeys assigned on one control)... Ant it does not use
Application.OnMessage, which slow down program performance.
The component is provided with source code (commented :) but it has no
documentation (I've got no time to wrote it)... It is completely
FREEWARE as all Delphi components should be... (take it for free give it
for free...)...
The key properties and events are:

  HotKeys : TStringList;
--------------------------
    A list of strings containing hot-key combination is plain text
(ALT+X, CTRL+C, etc.). They are converted to TShortCut type and
registered for the control window (invisible at runtime) as a hotkey.
When any hotkey is pressed on the form, it generates the OnHotKey event.

  Active : Boolean
--------------------------
  Determines if the hotkeys are active or not.

   OnHotKey: procedure (Sender: TObject; HotKey: TShortCut);
--------------------------
   Event triggered when any registered hot-key is pressed. You can find
which hot-key was pressed by testing the HotKey parameter.

---
  If you think this can help you, just send me an e-mail and I will send
the component to you as soon as I read your message... I will also send
an example program that demonstrates the use of the component... (Both
together are only 35kb zipped (only source))...

Hope I can help,
    Felipe Rocha Machado
    GPS Tecnologia Ltda.

Quote
Kees Lagendijk wrote:
> I want my users to have help under F1 at any position in the app
> without
> having to add HelpID / numbers to all objects.
> Ho do I do that ?
> Is there an application.hotkey or something like that ?

> Kees Lagendijk

Other Threads