首页 > comp > gb.qt4 > key > control 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh eo
前一个  下一个  编辑  重命名  撤销  搜索  管理  
文档  
警告! 该页面未翻译。  参见英文版 
Key.Control (gb.qt4)
Static Property Read Control As Boolean

Returns if the CONTROL key is pressed.

This is inside ..._KeyPress or ..._KeyRelease Events.
Keys may have functions assigned to them by OS or other programs; you could close/... your program/other programs/system.

Example

' 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

参见

  KeyPress, , KeyRelease