Board index » cppbuilder » Function Key Assignment

Function Key Assignment


2008-01-21 11:49:22 PM
cppbuilder75
I'd like to set up function keys, F1, F2, etc so that with one click a
command is executed. For example press F1 and you go to a URL.
Thanks for any help.
EB
 
 

Re:Function Key Assignment

Hi EB
EB says:
Quote
I'd like to set up function keys, F1, F2, etc so that with one click a
command is executed. For example press F1 and you go to a URL.
Thanks for any help.
Set
KeyPreview = true;
on the form and then You can examine the Key in the form keydown
event and act accordingly.
if(Key == VK_F1)
ShellExecute......
Kind regards
Asger
 

Re:Function Key Assignment

Thank you for your response. I forgot to say that I use BCPPB 6.
Your suggetion works as long as the app is running. I want to run the app at
start time and program the keys to stay even when the app exits.
EB
"Asger Joergensen" < XXXX@XXXXX.COM >wrote in message
Quote

Hi EB

EB says:
>I'd like to set up function keys, F1, F2, etc so that with one click a
>command is executed. For example press F1 and you go to a URL.
>Thanks for any help.

Set
KeyPreview = true;
on the form and then You can examine the Key in the form keydown
event and act accordingly.

if(Key == VK_F1)
ShellExecute......

Kind regards
Asger
 

{smallsort}

Re:Function Key Assignment

Hi EB
EB says:
Quote
Thank you for your response. I forgot to say that I use BCPPB 6.
Your suggetion works as long as the app is running. I want to run the app at
start time and program the keys to stay even when the app exits.
EB
I don't know how to do it, but this link will take You to
a search for keyboard hooks which, I think, is what You need.
tinyurl.com/2qpcpp
Kind regards
Asger