Event XbpDialog():keyboard Foundation

Keyboard input received.

Syntax
:keyBoard := {| nKeyCode, uNIL, self | ... }
:keyBoard ( <nKeyCode> ) --> self
xbeP_Keyboard (1048580)
Parameters
<nKeyCode>
<nKeyCode> is the numeric key code of the pressed key.
Return

This method returns the object executing the method (self).

Description

The xbeP_Keyboard event is generated whenever input is made via the keyboard that does not correspond to a default event. The first parameter of the code block or the method contains the event code returned by AppEvent() which corresponds to the key pressed.

If an XbpDialog window is displayed via the method :showModal(), Enter and Escape key strokes are treated differently by the :keyboard() event handler method. If the Enter key is pressed and the :default member variable of a child object is .T. (true), an xbeP_Activate event is sent to this child object. Likewise, if the Esc key is pressed and :cancel is .T. for one of the children, xbeP_Activate event is sent to this child object instead.

This behaviour is used to activate the standard dialog elements of modal dialogs. Such elements are usually push buttons and have captions such as "Okay" or "Cancel". Pressing the Enter key activates the "Okay" (or equivalent) button, while the Escape key triggers the action associated with the "Cancel" (or equivalent) button.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.