simulate pressing the F2

This forum is for eXpress++ general support.
Post Reply
Message
Author
MIGUELON
Posts: 135
Joined: Wed Feb 10, 2010 10:55 am

simulate pressing the F2

#1 Post by MIGUELON »

Hi all, not if I can help.
I need to simulate pressing the F2 key, pressing a button. The code I am trying to use is the following but not working.


@ 20, 0 DCTOOLBAR oBotonesTecla SIZE 110,3 BUTTONSIZE 11,3


DCADDBUTTON CAPTION 'F2';
PARENT oBotonesTecla;
ACTION {||PostAppEvent(xbeK_F2,,,DC_GetListObject( GetList ))}


Thank you very much for your help. :think:
Miguel

User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Re: simulate pressing the F2

#2 Post by TWolfe »

Try the following:

ACTION {||PostAppEvent(xbeP_Keyboard,xbeK_F2,NIL,DC_GetListObject( GetList ))}

HTH,
Terry

MIGUELON
Posts: 135
Joined: Wed Feb 10, 2010 10:55 am

Re: simulate pressing the F2

#3 Post by MIGUELON »

Thank you very much for your help but I changed the code and gives me the error.
Attachments
F2.jpg
F2.jpg (59.92 KiB) Viewed 7763 times

User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Re: simulate pressing the F2

#4 Post by TWolfe »

The object needs to be the object receiving the keyboard events. If you do not have multiple event handlers, just try:

ACTION {||PostAppEvent(xbeP_Keyboard,xbeK_F2)}

This sends the event to the appWindow (The value of a SetAppWindow() call).

Otherwise you need to pass the object that will receive the event.

Terry

MIGUELON
Posts: 135
Joined: Wed Feb 10, 2010 10:55 am

Re: simulate pressing the F2

#5 Post by MIGUELON »

OK I works if the object as follows:
ACTION {||SetAppFocus(oOrigen),PostAppEvent(xbeP_Keyboard,xbeK_F2,,oOrigen)}

The problem is that not what the object where it is, there are several objects (gets)

Thank you very much
Miguel

Post Reply