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.
Miguel
simulate pressing the F2
Re: simulate pressing the F2
Try the following:
ACTION {||PostAppEvent(xbeP_Keyboard,xbeK_F2,NIL,DC_GetListObject( GetList ))}
HTH,
Terry
ACTION {||PostAppEvent(xbeP_Keyboard,xbeK_F2,NIL,DC_GetListObject( GetList ))}
HTH,
Terry
Re: simulate pressing the F2
Thank you very much for your help but I changed the code and gives me the error.
- Attachments
-
- F2.jpg (59.92 KiB) Viewed 7985 times
Re: simulate pressing the F2
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
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
Re: simulate pressing the F2
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
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