Vahx Vahx - 2 months ago 28
Vb.net Question

keyboard input with ctrl,alt, shift + key

I am coding some keyboard inputs to my code, but i'm having trouble figuring out how to get the keys that require a ctrl, alt or shift input as well.
I tried this but this just make the key work as soon as i press the alt key.
I am trying to use the + button that is not on the numpad.

Case Keys.ShiftKey And Keys.Oemplus
BTB_plus.PerformClick()


And Using
keys.Shift
does nothing at all

Also, if someone has a list of which key has what name in VB.NET, it would be appreciated. (or good tutorials on this subject)

Would prefer if someone could post the code for a select case statement, thx

Answer

If you want to use case statement I would then perform this:

Dim bHandled As Boolean = False
    Select Case e.Modifiers
        Case Keys.Control
            If e.KeyCode = Keys.Oemplus Then
                MsgBox("KeyPress CTRL + OEMPLUS")
                e.Handled = True
            End If

            If e.KeyCode = Keys.A Then
                MsgBox("KeyPress CTRL + A")
                e.Handled = True
            End If


        Case Keys.Shift
            If e.KeyCode = Keys.Oemplus Then
                MsgBox("KeyPress Shift + OEMPLUS")
                e.Handled = True
            End If

            If e.KeyCode = Keys.A Then
                MsgBox("KeyPress Shift + A")
                e.Handled = True
            End If

    End Select