Difference between revisions of "RectControl.KeyDown"

From Xojo Documentation

m
 
Line 9: Line 9:
 
}}  
 
}}  
 
{{Description
 
{{Description
|text = The user has pressed the ''Key'' passed while the [[RectControl]] has the focus. }}
+
|text = The user has pressed the ''Key'' passed while the [[RectControl | control]] has the focus. }}
  
 
== Notes ==
 
== Notes ==
Returns a [[Boolean]]. Returning [[True]] means that no further processing is to be done with the ''Key''.
+
How KeyDown works depends on the type of control.
 +
 
 +
'''TextField and TextArea'''
 +
Returning [[True]] means the key is intercepted, preventing the key from actually reaching the control at all. This would be useful if you want to override the behavior of the tab key for example. Returning [[False]] means the key reaches the control.
 +
 
 +
'''All Other Controls'''
 +
Returning [[True]] prevents the KeyDown event on the parent control (usually the window) from executing. Returning [[False]] results in the execution of the KeyDown event of the parent control.
  
 
==See Also==
 
==See Also==
 
[[Keyboard]] Module.
 
[[Keyboard]] Module.

Latest revision as of 22:27, 4 December 2019

Event


RectControl.KeyDown(Key as String) As Boolean

New in 2007r4

Supported for all project types and targets.

The user has pressed the Key passed while the control has the focus.

Notes

How KeyDown works depends on the type of control.

TextField and TextArea Returning True means the key is intercepted, preventing the key from actually reaching the control at all. This would be useful if you want to override the behavior of the tab key for example. Returning False means the key reaches the control.

All Other Controls Returning True prevents the KeyDown event on the parent control (usually the window) from executing. Returning False results in the execution of the KeyDown event of the parent control.

See Also

Keyboard Module.