Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Dependencies
Cpp
mirrage
Commits
f2ac702c
Commit
f2ac702c
authored
Sep 16, 2019
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/mirrage/input/include/mirrage/input/types.hpp
View file @
f2ac702c
...
...
@@ -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
...
...
src/mirrage/input/src/input_mapping.cpp
View file @
f2ac702c
...
...
@@ -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
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment