Commit f2ac702c authored by Florian Oetke's avatar Florian Oetke
Browse files

extended input system to allow distinction between on-press and on-release for once actions

parent 92518bbd
Pipeline #3217 passed with stage
in 13 minutes and 40 seconds
......@@ -186,7 +186,7 @@ namespace mirrage::input {
using Context_id = util::Str_id;
using Input_source = int8_t;
enum class Reaction_type { none, once, continuous, range };
enum class Reaction_type { none, once, once_down, continuous, range };
#ifdef sf2_structDef
......@@ -332,7 +332,7 @@ namespace mirrage::input {
sf2_structDef(Mouse_click, button, clicks);
sf2_enumDef(Reaction_type, none, once, continuous, range);
sf2_enumDef(Reaction_type, none, once, once_down, continuous, range);
#endif
} // namespace mirrage::input
......
......@@ -112,6 +112,7 @@ namespace mirrage::input {
break;
case Reaction_type::once:
case Reaction_type::once_down: bus.send<Once_action>(action.action, src); break;
default: break;
}
}
......@@ -146,6 +147,7 @@ namespace mirrage::input {
case Reaction_type::once: bus.send<Once_action>(action.action, src); break;
case Reaction_type::once_down:
default: break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment