Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

How do I detect a Ctrl-E keystroke?

Discussion in 'Information Technology' started by Nathan, Jul 28, 2006.

  1. Nathan

    Nathan
    Expand Collapse
    Guest

    I understand detecting the "E" part of this, but how do I capture a Cntrl-E?
    I want to be able to type data in a field, but have a window pop up on when
    Cntrl-E is pressed. The help file said to use acCtrlMask, but that seems to
    give the same value regardless of whether it is down or not. I'm confused.

    Thanks,

    Nathan
     
  2. Loading...

    Similar Threads Forum Date
    Internet Detectives, Boston Bombing, and Wrongly Accused Sunil Tripathi Information Technology Apr 24, 2013
    SciTech Hint of Dark Matter Found Using $2 Billion Cosmic Ray Detector Breaking News Apr 4, 2013
    SciTech India set for building prototype gravitational wave detector Breaking News Sep 19, 2010
    Modern Sikh Detective's Malaysian Case Perfect for the Beach Book Reviews & Editorials Aug 4, 2010
    World Honour for falsely accused Cranford detective Breaking News May 14, 2010

  3. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    use the Form's KeyDown Event (set KeyPreview to Yes) - or - the Control's
    KeyDown Event

    HTH

    Pieter

    "Nathan" <Nathan@discussions.microsoft.com> wrote in message
    news:E45E768D-712C-4DF7-BC4D-819B40B34491@microsoft.com...
    >I understand detecting the "E" part of this, but how do I capture a
    >Cntrl-E?
    > I want to be able to type data in a field, but have a window pop up on
    > when
    > Cntrl-E is pressed. The help file said to use acCtrlMask, but that seems
    > to
    > give the same value regardless of whether it is down or not. I'm
    > confused.
    >
    > Thanks,
    >
    > Nathan
     
  4. Nathan

    Nathan
    Expand Collapse
    Guest

    That part I understand, but how do I determine that the control key is down
    too? The user could press E during normal operation within this field and I
    only want the dialog triggered on Ctrl-E.

    Thanks

    Nathan

    "Pieter Wijnen" wrote:

    > use the Form's KeyDown Event (set KeyPreview to Yes) - or - the Control's
    > KeyDown Event
    >
    > HTH
    >
    > Pieter
    >
    > "Nathan" <Nathan@discussions.microsoft.com> wrote in message
    > news:E45E768D-712C-4DF7-BC4D-819B40B34491@microsoft.com...
    > >I understand detecting the "E" part of this, but how do I capture a
    > >Cntrl-E?
    > > I want to be able to type data in a field, but have a window pop up on
    > > when
    > > Cntrl-E is pressed. The help file said to use acCtrlMask, but that seems
    > > to
    > > give the same value regardless of whether it is down or not. I'm
    > > confused.
    > >
    > > Thanks,
    > >
    > > Nathan

    >
    >
    >
     
  5. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    there's an unique integer value associated with the key-combo (keycode ,
    shift)
    69, 0 (normal e)
    69,2 (ctrl+e)

    hth

    Pieter

    code sample

    Private Sub Text0_KeyDown(KeyCode As Integer, Shift As Integer)
    Debug.Print KeyCode, Shift
    End Sub



    "Nathan" <Nathan@discussions.microsoft.com> wrote in message
    news:EE78963E-2B55-4526-9522-1CC1061F164B@microsoft.com...
    > That part I understand, but how do I determine that the control key is
    > down
    > too? The user could press E during normal operation within this field and
    > I
    > only want the dialog triggered on Ctrl-E.
    >
    > Thanks
    >
    > Nathan
    >
    > "Pieter Wijnen" wrote:
    >
    >> use the Form's KeyDown Event (set KeyPreview to Yes) - or - the Control's
    >> KeyDown Event
    >>
    >> HTH
    >>
    >> Pieter
    >>
    >> "Nathan" <Nathan@discussions.microsoft.com> wrote in message
    >> news:E45E768D-712C-4DF7-BC4D-819B40B34491@microsoft.com...
    >> >I understand detecting the "E" part of this, but how do I capture a
    >> >Cntrl-E?
    >> > I want to be able to type data in a field, but have a window pop up on
    >> > when
    >> > Cntrl-E is pressed. The help file said to use acCtrlMask, but that
    >> > seems
    >> > to
    >> > give the same value regardless of whether it is down or not. I'm
    >> > confused.
    >> >
    >> > Thanks,
    >> >
    >> > Nathan

    >>
    >>
    >>
     
  6. kunyi

    kunyi
    Expand Collapse
    Guest

    "Nathan" <Nathan@discussions.microsoft.com> дÈëÓʼþ
    news:EE78963E-2B55-4526-9522-1CC1061F164B@microsoft.com...
    > That part I understand, but how do I determine that the control key is

    down
    > too? The user could press E during normal operation within this field and

    I
    > only want the dialog triggered on Ctrl-IF.
    >
    > Thanks
    >
    > Nathan
    >
    > "Pieter Wijnen" wrote:
    >
    > > use the Form's KeyDown Event (set KeyPreview to Yes) - or - the

    Control's
    > > KeyDown Event
    > >
    > > HTH
    > >
    > > Pieter
    > >
    > > "Nathan" <Nathan@discussions.microsoft.com> wrote in message
    > > news:E45E768D-712C-4DF7-BC4D-819B40B34491@microsoft.com...
    > > >I understand detecting the "E" part of this, but how do I capture a
    > > >Cntrl-E?
    > > > I want to be able to type data in a field, but have a window pop up on
    > > > when
    > > > Cntrl-E is pressed. The help file said to use acCtrlMask, but that

    seems
    > > > to
    > > > give the same value regardless of whether it is down or not. I'm
    > > > confused.
    > > >
    > > > Thanks,
    > > >
    > > > Nathan

    > >
    > >
    > >
     
  7. Rick Wannall

    Rick Wannall
    Expand Collapse
    Guest

    Make a form with two text boxes on it to run this code:

    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

    Me.Text0 = KeyCode
    Me.Text2 = Shift

    End Sub

    Set KeyPreview to yes on the form. using KeyDown or KeyUp you can test
    KeyCode (in the event signature) to see the value of Shift.

    1=shift key
    2=control key
    4=alt key

    You can get combinations, for example 3 = control+shift.

    HTH
     

Share This Page