Page 1 of 1

xBrowse Trap Down Arrow key

Posted: Thu Apr 30, 2015 9:56 pm
by Rick Lipkin
To All

I am trying to trap the down arrow key in an xBrowse .. and this does not work

oLbxB:bKeyDown := { |nKey| MsgInfo(nKey) }

It traps 'Enter', "Insert' .. any ideas ?

Thanks
Rick Lipkin

Re: xBrowse Trap Down Arrow key

Posted: Fri May 01, 2015 2:24 am
by nageswaragunupudi
XBrowse does not allow this.
You need to write your own KeyDown() method and override and have a derived class.

Re: xBrowse Trap Down Arrow key

Posted: Wed Oct 21, 2020 5:46 pm
by FranciscoA
Hi Rick.
Do you resolved it?
Can share your solution?

Best regards.

Re: xBrowse Trap Down Arrow key

Posted: Wed Oct 21, 2020 5:52 pm
by Enrico Maria Giordano
I faced this problem this days and solved using bChange.

EMG

Re: xBrowse Trap Down Arrow key

Posted: Wed Oct 21, 2020 5:56 pm
by FranciscoA
Enrico.
Can you post a litle sample?
Thanks

Re: xBrowse Trap Down Arrow key

Posted: Wed Oct 21, 2020 7:26 pm
by Enrico Maria Giordano
Here it is:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBrw

    USE CUSTOMER

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 0, 0 XBROWSE oBrw

    oBrw:bChange = { || Test() }

    oBrw:CreateFromCode()

    ACTIVATE DIALOG oDlg;
             ON INIT oBrw:AdjClient();
             CENTER

    CLOSE

    RETURN NIL


STATIC FUNCTION TEST()

    IF GETKEYSTATE( VK_UP )
        ? "VK_UP"
    ENDIF

    IF GETKEYSTATE( VK_DOWN )
        ? "VK_DOWN"
    ENDIF

    RETURN NIL
EMG

Re: xBrowse Trap Down Arrow key

Posted: Wed Oct 21, 2020 8:26 pm
by FranciscoA
Great! Enrico.
Thanks

Re: xBrowse Trap Down Arrow key

Posted: Wed Oct 21, 2020 8:36 pm
by Rick Lipkin
Francisco

Enrico's solution is much better than mine .. I actually modified the xBrowse.prg code ..

Rick Lipkin

Re: xBrowse Trap Down Arrow key

Posted: Wed Oct 21, 2020 9:44 pm
by FranciscoA
Rick.
Got it.
Thanks for your kindly.