Documentation de Gambas - /comp/gb.qt4/key/control

/comp/gb.qt4/key/control

# Key.Control (gb.qt4)

Static Property Read Control As Boolean

Retourne si la touche `CONTROL` est appuyée.

Ceux-ci est à l'intérieur de l'évènement ..._KeyRelease ou ..._KeyPress.

Les touches peuvent avoir des fonctions qui leurs sont assignées par l'OS d'autres programmes; vous pourrez fermer/... votre programme/autres programmes/système.

### Exemples

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

    PUBLIC SUB Button1_KeyPress()
      IF Key.Control 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 CntrlDown AS Boolean
      TRY CntrlDown = Key.Control
      CntrlDown = IIf( ERROR , FALSE, CntrlDown)
      IF CntrlDown 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

### Voir aussi

- KeyPress ,

- KeyRelease