How can i have a keyboardevent allways transleted to another

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

How can i have a keyboardevent allways transleted to another

#1 Post by Markus Walter »

Hi,

what is the best way to "translate" a special Keyboard-Event to another for the whole application? f. e. User press "#" on keyboard and i want "translate" this to ESC (so that the application behaves like ESC was pressed).
Any hints are welcome.
-----------------
Greetings
Markus Walter

User avatar
digitsoft
Posts: 452
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: How can i have a keyboardevent allways transleted to ano

#2 Post by digitsoft »

This can help you
PostAppEvent (xbeP_Keyboard, 27,, SetAppFocus ())

Paulino Nolberto
Regards
Nolberto Paulino
Regards

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How can i have a keyboardevent allways transleted to ano

#3 Post by rdonnay »

If all your windows are eXpress++ windows you could use the DC_ReadGuiHandler() funtion.

Code: Select all

FUNCTION Main()

DC_ReadGuiHandler({|a,b,c,d|MyGlobalHandler(a,b,c,d)})

....

RETURN nil

* ------------

FUNCTION MyGlobalHandler( nEvent, mp1, mp1, oXbp )

IF nEvent == xbeP_Keyboard .AND. Chr(mp1) = '#'
  PostAppEvent(xbeP_Keyboard, xbeK_ESC,, oXbp )
  RETURN DCGUI_IGNORE
ENDIF

RETURN DCGUI_NONE

The eXpress train is coming - and it has more cars.

User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

Re: How can i have a keyboardevent allways transleted to ano

#4 Post by Markus Walter »

Hi Roger,

thanks for the hint.

I still have a global handler function and i make the same thing with F10 to prevent that the Menubar receives focus, but have i still forgotten this... Sorry.
-----------------
Greetings
Markus Walter

Post Reply