#include <Pt/Forms/Key.h>
Key code and modifiers. More...
Classes | |
| class | Modifiers |
| Stores a set of key modifier flags. More... | |
Public Types | |
| enum | Code |
| Defines key codes. | |
| enum | Modifier |
| Defines key modifier flags. | |
Public Member Functions | |
| Key () | |
| Creates an empty key. | |
| Key (Pt::uint32_t c) | |
| Creates a key with code c and no modifiers. | |
| Key (Modifier m, Pt::uint32_t c) | |
| Creates a key with modifier m and code c. | |
| Key (Modifiers m, Pt::uint32_t c) | |
| Creates a key with modifiers m and code c. | |
| void | clear () |
| Resets this key to NoKey with no modifiers. | |
| void | set (Pt::uint32_t c) |
| Sets the code to c and removes all modifiers. | |
| void | set (Modifier m, Pt::uint32_t c) |
| Sets the modifier to m and the code to c. | |
| void | set (Modifiers m, Pt::uint32_t c) |
| Sets the modifiers to m and the code to c. | |
| Pt::uint32_t | code () const |
| Returns the key code. | |
| Modifiers | modifiers () const |
| Returns the key modifiers. | |
| bool | operator== (const Key &k) const |
| Returns true when this key equals k. | |
| bool | operator!= (const Key &k) const |
| Returns true when this key does not equal k. | |
| bool | operator< (const Key &k) const |
| Returns true when this key sorts before k. | |
| bool | empty () const |
| Returns true when the key code is NoKey. | |
Static Public Member Functions | |
| static Pt::String | toString (Pt::uint32_t code) |
| Converts the key code to a string. More... | |
A Key identifies a physical or logical key, optionally with modifier flags such as Shift or Control. KeyEvent carries a Key together with press or release and optional Unicode text.
|
static |
The returned string can be used with the translator.