Files
MuditaOS/module-gui/gui/input/InputEvent.cpp
pholat 938cbc186a Gui text pr1 utils and fixes (needed for gui::Text rewrite mostly) (#485)
* EGD-3229 [FIX] UTF8 fixed uint32_t range error

* EGD-3229 [util] gui::Item Navigation switch case moved to function

Needed to not copy senslessly NavigationDirection enum switch case
* gui::Item Navigation switch case moved to function
* added NavigationDirection::None enum value
* cleaned up Navigation.hpp/cpp

* EGD-3229 [util] gui: InputEvent - str() for logging added & is...() check methods

* EGD-3229 [util] removed notorious log on unknown glyph

* EGD-3229 [util] InputMode - added is(Mode) method, input Profile added default definition

* is() method addded to check instead of `==` comparison
* added default to Profile instead of `== 0` use

* [FIX] ARM GCC 10.1.0 - build fixed

fixed include in wrong place

* PR style fix

* Review applied
2020-07-01 13:14:07 +02:00

18 lines
440 B
C++

#include "InputEvent.hpp"
namespace gui
{
InputEvent::InputEvent(RawKey key, State state, KeyCode keyCode) : key(key), state(state), keyCode(keyCode)
{}
std::string InputEvent::str() const
{
std::stringstream ss;
ss << "KeyCode: " << c_str(keyCode) << " ";
ss << "State: " << c_str(state) << " ";
ss << "short press: " << isShortPress();
return ss.str();
}
}; // namespace gui