xtd 0.2.0
console_key_info.h
Go to the documentation of this file.
1 #pragma once
5 #include "console_key.h"
6 #include "console_modifiers.h"
7 #include "iequatable.h"
8 #include "object.h"
9 #include <iostream>
10 
12 namespace xtd {
22  class console_key_info final : public object, public xtd::iequatable<console_key_info> {
23  public:
25 
30  console_key_info() noexcept = default;
31 
40  console_key_info(char32 key_char, console_key key, bool shift, bool alt, bool control) noexcept;
42 
44  console_key_info(const console_key_info& key_info) noexcept = default;
45  console_key_info& operator =(const console_key_info& key_info) noexcept = default;
47 
49 
53  console_key key() const noexcept;
54 
57  char32 key_char() const noexcept;
58 
61  console_modifiers modifiers() const noexcept;
63 
65 
67  bool equals(const console_key_info& key_info) const noexcept override;
69 
70  private:
71  char32 key_char_ {0};
72  console_key key_ {static_cast<console_key>(0)};
73  console_modifiers modifiers_ {static_cast<console_modifiers>(0)};
74  };
75 }
Contains xtd::iequatable interface.
Contains xtd::console_key enum class.
console_key key() const noexcept
Gets the console key represented by the current console_key_info object.
console_modifiers
Represents the SHIFT, ALT, and CTRL modifier keys on a keyboard.
Definition: console_modifiers.h:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
bool equals(const console_key_info &key_info) const noexcept override
Indicates whether the current object is equal to another object of the same type. ...
The left or right SHIFT modifier key.
char32 key_char() const noexcept
Gets the Unicode character represented by the current console_key_info object.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:18
console_key_info() noexcept=default
Create a new instance of console_key_info class.
The left or right ALT modifier key.
Specifies the standard keys on a console.
Definition: console_key_info.h:22
Contains xtd::object class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
Contains xtd::console_modifiers enum class.
char32_t char32
Represents a 32-bit unicode character.
Definition: types.h:85
console_modifiers modifiers() const noexcept
Gets a bitwise combination of console_modifiers values that specifies one or more modifier keys press...
The left or right CTRL modifier key.
console_key
Specifies the standard keys on a console.
Definition: console_key.h:18