#include <key_press_event_args.h>
Provides data for the key_press event.
- Namespace
- xtd::forms
- Library
- xtd.forms
- Note
- Some controls will process certain key strokes on key_down. For example, rich_text_box processes the Enter key before key_press is called. In such cases, you cannot cancel the key_press event, and must cancel the key stroke from key_down instead.
Inherits xtd::event_args.
|
| | key_press_event_args ()=default |
| | Initializes a new instance of the KeyPressEventArgs class.
|
| |
| | key_press_event_args (char32_t key_char) |
| | Initializes a new instance of the KeyPressEventArgs class.
|
| |
| bool | handled () const |
| | Gets a value indicating whether the key_press event was handled.
|
| |
| void | handled (bool handled) |
| | Sets a value indicating whether the key_press event was handled.
|
| |
| char32_t | key_char () const |
| | Gets the character corresponding to the key pressed.
|
| |
| void | key_char (char32_t key_char) |
| | Sets the character corresponding to the key pressed.
|
| |
| | 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.
|
| |
| template<typename object_t > |
| std::unique_ptr< object_t > | memberwise_clone () const |
| | Gets the type of the current instance.
|
| |
| virtual xtd::ustring | to_string () const noexcept |
| | Returns a std::string that represents the current object.
|
| |
|
| static const event_args | empty |
| | Provides a value to use with events that do not have event data.
|
| |
| static bool | equals (const object &object_a, const object &object_b) noexcept |
| | Determines whether the specified object instances are considered equal.
|
| |
| static bool | reference_equals (const object &object_a, const object &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_t |
key_char | ) |
|
|
inline |
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 |
|
inline |
Gets a value indicating whether the key_press event was handled.
- Returns
- true if the event is handled; otherwise, false.
◆ handled() [2/2]
| void xtd::forms::key_press_event_args::handled |
( |
bool |
handled | ) |
|
|
inline |
Sets a value indicating whether the key_press event was handled.
- Parameters
-
| handled | true if the event is handled; otherwise, false. |
◆ key_char() [1/2]
| char32_t xtd::forms::key_press_event_args::key_char |
( |
| ) |
const |
|
inline |
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_t |
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: