Page 1 of 1

Key

Posted: Tue May 10, 2011 2:29 pm
by MIGUELON
Hi all, anyone know how I can simulate a keystroke.
For example ENTER, ESC 1,2,3,4,5 etc.

Thank you very much ;)
Miguel

Re: Key

Posted: Tue May 10, 2011 2:36 pm
by Auge_Ohr
MIGUELON wrote:Hi all, anyone know how I can simulate a keystroke.
For example ENTER, ESC 1,2,3,4,5 etc.
please tell us how you want to use it ?

VIO Mode -> KEYBOARD ( Chr(K_ENTER) )
GUI Mode -> PostAppEvent(xbeP_Keyboard,xbe_K_ENTER,,Object)

... or do you want to "send" it to a "other" Application ?

Re: Key

Posted: Wed May 11, 2011 1:11 am
by MIGUELON
Thanks for the reply Jimmy the problem is that there are many objects window and also a dcbrowse and do not know which is the object that has the current focus to use: PostAppEvent (xbeP_Keyboard, xbe_K_ENTER,, Object)

Thanks
Miguel

Re: Key

Posted: Wed May 11, 2011 8:42 am
by Auge_Ohr
MIGUELON wrote:... the problem is that there are many objects window and also a dcbrowse and do not know which is the object that has the current focus to use:
SetAppWindow() return "active" Window while SetAppFocus() allways return "active" XbPart.
XbParts "normal" are placed on o:DrawingArea so you will find them in o:DrawingArea:Childlist()
MIGUELON wrote:PostAppEvent (xbeP_Keyboard, xbe_K_ENTER,, Object)
did you realy need to "send" a Event or do you want to "react" on it ?
if you want "react" on it you might use o:Keyboard Slot of a XbPart for it.

Re: Key

Posted: Thu May 12, 2011 2:14 am
by MIGUELON
What I am trying to do is put multiple buttons within a window that simulates pressing a key. It is a virtual keyboard buttons from DCADDBUTTON

FOR EXAMPLE:

@ nFila, 0 DCTOOLBAR oBotonesTecla SIZE 110,3 BUTTONSIZE 11,3 HIDE {||! M->lEditModoVenta }


DCADDBUTTON CAPTION 'TOTAL';
PARENT oBotonesTecla;
ACTION {|o|o:=DC_GetListObject( GetList ),SetAppFocus(o), PostAppEvent(xbeP_Keyboard,xbeK_ENTER,,o)}


Jimmy thank you very much
Miguel