Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #10329

Re: a short question

From "Karl-Heinz" <invalid@invalid.invalid>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: a short question
Date 2017-03-23 09:16 +0100
Message-ID <ejhejrF2933U1@mid.individual.net> (permalink)
References <128a2508-a92e-4dcd-862b-08b5bb3fd113@googlegroups.com>

Show all headers | View raw


Hi Gunter,

> how can I catch a function key pressed in a dialog window without any edit
> control?

Here“s a sample how to trap e.g. the key F9. Each time the window is
activated the key  will be registered, otherwise unregistered.

----------------
METHOD Dispatch ( oEvent ) CLASS  YourDlg

   DO CASE

   CASE oEvent:message == WM_HOTKEY

            SELF:OnHotKey ( oEvent:wparam )


   ENDCASE

   RETURN SUPER:Dispatch ( oEvent )

------------------

METHOD OnHotKey ( dwKey ) CLASS YourDlg


    DO CASE
    CASE dwKey ==101
       ? "Hotkey  F9 pressed"

    ENDCASE

    RETURN SELF

METHOD Activate(oEvent) CLASS YourDlg

SUPER:Activate(oEvent)

SELF:__RegisterHotkeys( TRUE )


RETURN NIL
------------------

METHOD Deactivate(oEvent) CLASS YourDlg

SUPER:Deactivate(oEvent)

SELF:__RegisterHotkeys( FALSE )

RETURN NIL
-------------------------------
METHOD __RegisterHotkeys ( lRegister ) CLASS YourDlg

    IF lRegister
        RegisterHotKey(SELF:Handle(), 101, 0 , VK_F9)

    ELSE
       UnregisterHotKey(SELF:Handle(), 101)

    ENDIF


    RETURN SELF


regards
Karl-Heinz 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

a short question Gunter <g.huebner@dsh-anklam.de> - 2017-03-22 02:44 -0700
  Re: a short question Frans Wauters <info@wautersit.com> - 2017-03-22 04:33 -0700
    Re: a short question Robert van der Hulst <rjvanderhulst@gmail.com> - 2017-03-22 06:34 -0700
      Re: a short question Frans Wauters <info@wautersit.com> - 2017-03-23 16:25 -0700
  Re: a short question "Karl-Heinz" <invalid@invalid.invalid> - 2017-03-23 09:16 +0100
  Re: a short question Gunter <g.huebner@dsh-anklam.de> - 2017-03-23 02:36 -0700

csiph-web