comp • gb.qt4 • key • shift

Key.Shift (gb.qt4)

Static Property Read Shift As Boolean

Returns if the SHIFT key is pressed.

This is inside ..._KeyPress or ..._KeyRelease Events.

Examples

' Needing a Button1; with the focus on it( Use the Tab key).
' can cut and Paste this  example.

Public Sub Button1_KeyPress()
  If Key.Shift Then
    Button1.Text = " True " & CString(Time)
  Else
    Button1.Text = " False " & CString(Time)
  Endif
End
Public Sub Form_KeyPress()
' Control KeyPress event will often pass through to this Form event.
  Dim altSet As Boolean
  Try altSet = Key.Shift
  altSet = IIf( Error , False, altSet)
  If altSet Then
    Me.Text = CString(Time) & " True: Control key is being held down"
  Else
    Me.Text = CString(Time) & " False: Control key was not held down"
  Endif
End

See also