Key

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

Key

#1 Post 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

User avatar
Auge_Ohr
Posts: 1421
Joined: Wed Feb 24, 2010 3:44 pm

Re: Key

#2 Post 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 ?
greetings by OHR
Jimmy

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

Re: Key

#3 Post 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

User avatar
Auge_Ohr
Posts: 1421
Joined: Wed Feb 24, 2010 3:44 pm

Re: Key

#4 Post 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.
greetings by OHR
Jimmy

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

Re: Key

#5 Post 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

Post Reply