Provides data for the xtd::forms::control::key_press event.
- Header
#include <xtd/forms/key_press_event_args>
- Namespace
- xtd::forms
- Library
- xtd.forms
- Note
- Some controls will process certain key strokes on xtd::forms::control::key_down. For example, rich_text_box processes the Enter key before xtd::forms::control::key_press is called. In such cases, you cannot cancel the xtd::forms::control::key_press event, and must cancel the key stroke from xtd::forms::control::key_down instead.
- Examples:
- calculator.cpp, key_events.cpp, and numeric_text_box.cpp.
◆ key_press_event_args() [1/2]
xtd::forms::key_press_event_args::key_press_event_args |
( |
| ) |
|
|
default |
Initializes a new instance of the KeyPressEventArgs class.
◆ key_press_event_args() [2/2]
xtd::forms::key_press_event_args::key_press_event_args |
( |
char32 |
key_char | ) |
|
|
inlineexplicit |
Initializes a new instance of the KeyPressEventArgs class.
- Parameters
-
key_char | The ASCII character corresponding to the key the user pressed. |
◆ handled() [1/2]
bool xtd::forms::key_press_event_args::handled |
( |
| ) |
const |
|
inlinenoexcept |
◆ handled() [2/2]
void xtd::forms::key_press_event_args::handled |
( |
bool |
handled | ) |
|
|
inline |
Sets a value indicating whether the xtd::forms::control::key_press event was handled.
- Parameters
-
handled | true if the event is handled; otherwise, false. |
◆ key_char() [1/2]
char32 xtd::forms::key_press_event_args::key_char |
( |
| ) |
const |
|
inlinenoexcept |
Gets the character corresponding to the key pressed.
- Returns
- The ASCII character that is composed. For example, if the user presses SHIFT + K, this property returns an uppercase K.
- Note
- For information about how to detect any of the non-character keys mentioned above, see the key_event_args class.
- Examples:
- calculator.cpp, and numeric_text_box.cpp.
◆ key_char() [2/2]
void xtd::forms::key_press_event_args::key_char |
( |
char32 |
key_char | ) |
|
|
inline |
Sets the character corresponding to the key pressed.
- Parameters
-
key_char | The ASCII character that is composed. For example, if the user presses SHIFT + K, this property returns an uppercase K. |
- Note
- For information about how to detect any of the non-character keys mentioned above, see the key_event_args class.
The documentation for this class was generated from the following file: