Key down 10.2b

jmac13

Member
Hi all,

I was wondering can you Detect when a key combination is Active? e.g. ctrl + F.

I want it so that if the user is holding this down the cursor will change to something else when hovering over a button to denote a different action.

Cheers

Jmac13
 
Were you looking for this ?
Code:
READKEY.
MESSAGE LAST-EVENT:LABEL SKIP
        LAST-EVENT:EVENT-TYPE
    VIEW-AS ALERT-BOX INFO BUTTONS OK.
 
ermm kind of but where does this code go? the main block? plus would it Detect it the once.. I can of want to do one thing when the keys are held down then go back to a different mode once they are released
 
You'd have to check if the keys are pressed each time you want to use the information I think. So in the click event of the button, check to see if CTRL+F was pressed at the time of the click and process accordingly.
 
ermm thought so.. has to be on click.. to fire the event.. never mind I'll do it another way thanks guys
 
just playing around...

Code:
DEFINE BUTTON Btn_Exit LABEL "Exit":U.

DEFINE FRAME MyFrame
    Btn_Exit AT ROW 21 COL 62 .

ON 'ANY-KEY':U ANYWHERE
DO:

    MESSAGE 
        LAST-EVENT:LABEL SKIP
        LAST-EVENT:EVENT-TYPE
    VIEW-AS ALERT-BOX INFO BUTTONS OK.

    CASE LAST-EVENT:LABEL :

        WHEN "ENTER:" THEN
            APPLY "CHOOSE":U TO Btn_Exit IN FRAME MyFrame.

        WHEN "CTRL-F" THEN
        DO:
            SESSION:set-wait-state("GENERAL":U). /* Hour glass */
            PAUSE. /* not needed.... used it only to disp the hour glass*/
/*             RUN P_SomeLogic. */
            SESSION:set-wait-state(""). /* Arrrow*/
        END.
    END CASE.
END.

ON 'CHOOSE':U OF Btn_Exit
DO:
    APPLY "CLOSE":U TO THIS-PROCEDURE.
    RETURN NO-APPLY.
END.

ENABLE Btn_Exit WITH FRAME MyFrame.
WAIT-FOR "CLOSE":U OF THIS-PROCEDURE.
 
on click on button if you want to check if CTRL-F was pressed.. then on CTRL-F you may have flag it....
 
cheers rzr thats pretty good..



I'll have to have a mess around with the code... though this will set the cursor different overall... rather than just round the hit area around the button...e.g. when you hover over the button i get a glove shape... i don’t think progress has and knowledge of this kind of thing
 
Back
Top