xtd 0.2.0
key_press_event_args.h
Go to the documentation of this file.
1 #pragma once
5 #include <xtd/event_args>
6 
8 namespace xtd {
10  namespace forms {
25  public:
27 
31  key_press_event_args() = default;
35  explicit key_press_event_args(char32 key_char) : key_char_(key_char) {}
37 
40  key_press_event_args& operator =(const key_press_event_args& key_press_event_args) = default;
42 
44 
49  bool handled() const noexcept {return handled_;}
53  void handled(bool handled) {handled_ = handled;}
54 
74  char32 key_char() const noexcept {return key_char_;}
94  void key_char(char32 key_char) {key_char_ = key_char;}
96 
97  private:
98  char32 key_char_;
99  bool handled_ = false;
100  };
101  }
102 }
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
char32 key_char() const noexcept
Gets the character corresponding to the key pressed.
Definition: key_press_event_args.h:74
key_press_event_args()=default
Initializes a new instance of the KeyPressEventArgs class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
key_press_event_args(char32 key_char)
Initializes a new instance of the KeyPressEventArgs class.
Definition: key_press_event_args.h:35
void key_char(char32 key_char)
Sets the character corresponding to the key pressed.
Definition: key_press_event_args.h:94
bool handled() const noexcept
Gets a value indicating whether the xtd::forms::control::key_press event was handled.
Definition: key_press_event_args.h:49
void handled(bool handled)
Sets a value indicating whether the xtd::forms::control::key_press event was handled.
Definition: key_press_event_args.h:53
Provides data for the xtd::forms::control::key_press event.
Definition: key_press_event_args.h:24
char32_t char32
Represents a 32-bit unicode character.
Definition: types.h:85
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13