Handle mouse events in key_to_str

This commit is contained in:
Maxime Coste 2015-03-28 18:18:28 +00:00
parent c174ca62bd
commit 56b5300b9d
2 changed files with 5 additions and 0 deletions

View File

@ -100,6 +100,9 @@ KeyList parse_keys(StringView str)
String key_to_str(Key key)
{
if (key.modifiers & Key::Modifiers::MouseEvent)
return "<mouse event>";
bool named = false;
String res;
auto it = find_if(keynamemap, [&key](const KeyAndName& item)

View File

@ -24,6 +24,8 @@ struct Key
MousePos = 1 << 4,
MouseWheelDown = 1 << 5,
MouseWheelUp = 1 << 6,
MouseEvent = MousePress | MouseRelease | MousePos |
MouseWheelDown | MouseWheelUp,
};
enum NamedKey : Codepoint
{