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

Post Reply
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

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

Post by Enrico Maria Giordano »

This is a sample:

Code: Select all

#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

if bKeyAction != nil .and. lAnd( nFlags, 16777216 ) // function Key
Is it intentional?

EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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

Code: Select all

#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
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico,

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

Thanks!
regards, saludos

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

Post by Antonio Linares »

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
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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
Post Reply