Hello,

This stupid question has got me stumped! How do I press F2 key within
command button? Way back when I thought INKEY() was the answer, but....

Thanks for the help.
RS

Re: Keypress via command button? by Olaf

Olaf
Tue Oct 17 13:50:45 CDT 2006

Hi Roy,

perhaps Keyboard '{F2}' Plain?

Bye, Olaf.



Re: Keypress via command button? by Dan

Dan
Tue Oct 17 15:43:10 CDT 2006

I *think* you're asking how to respond to a press of F2.

Look at object.keypress() and form.KeyPreview in the help file.

Also please review the Windows interface guidelines. You'll find almost all
F-key (and cominations with ctrl and alt) have things they're *supposed* to
do. You'll want to stick with those guidelines.

Dan

Roy Stoner wrote:
> Hello,
>
> This stupid question has got me stumped! How do I press F2 key within
> command button? Way back when I thought INKEY() was the answer,
> but....
>
> Thanks for the help.
> RS



Re: VFP9: Keypress via command button? by Josh

Josh
Tue Oct 17 20:32:19 CDT 2006


Keyboard {F2}


On Tue, 17 Oct 2006 12:51:09 -0600, "Roy Stoner" <rstoner1995@hotmail.com>
wrote:

>Hello,
>
>This stupid question has got me stumped! How do I press F2 key within
>command button? Way back when I thought INKEY() was the answer, but....
>
>Thanks for the help.
>RS
>


--- AntiSpam/harvest ---
Remove X's to send email to me.

Re: VFP9: Keypress via command button? by Gene

Gene
Tue Oct 17 20:48:27 CDT 2006

[reordered to chronological]

Josh Assing <XjoshX@jassing.com> wrote:

>On Tue, 17 Oct 2006 12:51:09 -0600, "Roy Stoner" <rstoner1995@hotmail.com>
>wrote:

>>This stupid question has got me stumped! How do I press F2 key within
>>command button? Way back when I thought INKEY() was the answer, but....

>Keyboard {F2}

keyboard takes a string, so put it in quotes:
keyboard "{f2}"

Make sure that you issue the keyboard command before whatever
needs the keystrokes is called. For example, in my report class, I
set the paper orientation with sys(1037). First comes the keyboard
command, then the keystroke consumer.
keyboard "{tab}{tab}{tab}{tab}o{enter}" clear
sys(1037)

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.