detect shift, alt and ctrl keys

Discussion in 'Questions (Windows Mobile)' started by micro, Jul 26, 2008.

  1. micro

    micro Well-Known Member Licensed User

    hi to all,
    how i can control the pressure of simultaneous keys "shift or ctrl or alt" with other keys with the library door?
    The KeyPress event with door is the same as basic4ppc, I think I should use the KeyEventHandler for ceck all keys, is right?
    And how can I use it?

    Thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Are these key presses related to a specific control (maybe TextBox)?
     
  3. micro

    micro Well-Known Member Licensed User

    Yes Erel,
    the control are TextBox.

    Best Regards
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    See the attached file.
    Code:
    Sub Globals
        
    'Declare the global variables here.

    End Sub

    Sub App_Start
        Form1.Show
        object.New1(
    false)
        object.FromControl(
    "textbox1")
        
    event.New1(object.Value,"KeyDown")
    End Sub
    Sub event_NewEvent
        object.Value = 
    event.Data
        keys = object.GetProperty(
    "Modifiers")
        
    If StrIndexOf("Alt",keys,0) > -1 Then 'handle alt
            form1.Text = "alt"
        
    End If
        
    If StrIndexOf("Shift",keys,0) > -1 Then 'handle shift
            form1.Text = "shift"
        
    End If
        
    If StrIndexOf("Control",keys,0) > -1 Then 'handle alt
            form1.Text = "control"
        
    End If
    End Sub
     

    Attached Files:

  5. micro

    micro Well-Known Member Licensed User

    ok Erel, it's work.
    I added the event KeyUp to make null the variable keys.
    What are the other properties of GetProperty than "Modifiers"?
    Where can I find other features more detailed?
    And if I want to capture the scan code (for all keys)?

    Thanks
     
    Last edited: Jul 26, 2008
  6. Erel

    Erel Administrator Staff Member Licensed User

  7. micro

    micro Well-Known Member Licensed User

    thanks Erel, :sign0188:

    Best Regards
     
  8. MM2forever

    MM2forever Active Member Licensed User

    Last edited: Jul 30, 2008
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice