Consultor Eletrônico



Kbase P111265: Is is possible to know from the 4GL whether the Shift key was pressed during a mouse event?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

Is is possible to know from the 4GL whether the Shift key was pressed during a mouse event?

FIX:

Not directly.

Under Windows, it's possible to invoke the Win32 API GetKeyState() function from within a 4GL trigger. For example:

ON MOUSE-SELECT-CLICK OF <widget phrase>
DO:
&GLOBAL-DEFINE VK_SHIFT 16
DEFINE VARIABLE liState AS INTEGER NO-UNDO.

RUN GetKeyState({&VK_SHIFT},OUTPUT liState).

IF liState < 0 THEN DO:
MESSAGE "Shift is pressed" VIEW-AS ALERT-BOX.
END.
END.

PROCEDURE GetKeyState EXTERNAL "USER32.DLL":
DEFINE INPUT PARAMETER intVirtKey AS LONG.
DEFINE RETURN PARAMETER intResult AS SHORT.
END PROCEDURE.