nKey return Value

Post Reply
areang
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

nKey return Value

Post by areang »

Hi All !

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

Thanks

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

Re: nKey return Value

Post 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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Areang,

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

James
Post Reply