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.
|
static const event_args | empty |
| Provides a value to use with events that do not have event data.
|
|
| event_args ()=default |
| Initializes a new instance of the event_args class.
|
|
| object ()=default |
| Create a new instance of the ultimate base class object.
|
|
virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object.
|
|
virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type.
|
|
virtual type_object | get_type () const noexcept |
| Gets the type of the current instance.
|
|
template<typename object_t > |
xtd::uptr< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object.
|
|
virtual xtd::string | to_string () const noexcept |
| Returns a xtd::string that represents the current object.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance.
|
|
◆ 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.
◆ 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: