Page 1 of 1

nKey return Value

Posted: Wed Oct 18, 2006 6:56 am
by areang
Hi All !

How to get nKey return value of Alt+F1, Ctrl+F1 and Shift+F1

Thanks

Best Regard
Areang

Re: nKey return Value

Posted: Wed Oct 18, 2006 7:24 am
by Enrico Maria Giordano
This is a sample for Ctrl+F1 and Shift+F1:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL cVar := SPACE( 30 )

    SETKEY( VK_F1, { || Keys() } )

    DEFINE DIALOG oDlg

    @ 1, 1 GET cVar OF oDlg

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

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


STATIC FUNCTION KEYS()

    IF GETKEYSTATE( VK_CONTROL )
        ? "CTRL-F1"
    ENDIF

    IF GETKEYSTATE( VK_SHIFT )
        ? "SHIFT-F1"
    ENDIF

    RETURN NIL
EMG

Posted: Wed Oct 18, 2006 7:08 pm
by James Bott
Areang,

I believe the Alt keys are reserved for Windows (menus and hot-keys).

James