Why only VK_F?? keys can be redefined using SetKey()?

Why only VK_F?? keys can be redefined using SetKey()?

Postby Enrico Maria Giordano » Tue Sep 12, 2006 2:28 pm

This is a sample:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL nVar := 0

    SETKEY( ASC( "-" ), { || MsgInfo( "Minus pressed" ) } )
    SETKEY( VK_F2, { || MsgInfo( "F2 pressed" ) } )

    DEFINE DIALOG oDlg

    @ 1, 1 GET nVar OF oDlg;
           PICTURE "99999";
           RIGHT

    @ 3, 1 BUTTON "&Close" OF oDlg ACTION oDlg:End()

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


And this is the cause:

Code: Select all  Expand view
if bKeyAction != nil .and. lAnd( nFlags, 16777216 ) // function Key


Is it intentional?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Sep 12, 2006 4:35 pm

Enrico,

> Is it intentional?

It looks so :-)

Does Clipper allow to use SetKey() with any key ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Tue Sep 12, 2006 4:46 pm

Antonio Linares wrote:Does Clipper allow to use SetKey() with any key ?


Yes:

Code: Select all  Expand view
#include "Inkey.ch"


FUNCTION MAIN()

    LOCAL GetList := {}

    LOCAL nVar := 0

    CLS

    SETKEY( ASC( "-" ), { || QOut( "Minus pressed" ) } )
    SETKEY( K_F2, { || QOut( "F2 pressed" ) } )

    @ 1, 1 GET nVar PICTURE "99999"

    READ

    INKEY( 0 )

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Sep 12, 2006 4:52 pm

Enrico,

Then we should remove ".and. lAnd( nFlags, 16777216 )"

Thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Tue Sep 12, 2006 5:00 pm

Enrico,

Lets wait a moment... we used that code because function keys provide chars values like standard keys (non function).

If we remove that code, how will we distinct them ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Tue Sep 12, 2006 6:12 pm

Antonio Linares wrote:Enrico,

Lets wait a moment... we used that code because function keys provide chars values like standard keys (non function).

If we remove that code, how will we distinct them ?


I don't know, sorry. Let's keep it unchanged till we'll found a solution.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: betoncu, Google [Bot] and 83 guests

cron