 |
Gorgon Game Engine
|
Go to the documentation of this file.
7 #include "../Animation.h"
10 namespace Gorgon {
namespace Input {
24 event.Unregister(
token);
62 KeyRepeater(E_ &event,
const std::initializer_list<Key> &keys,
int delay = 100);
65 KeyRepeater(
const std::initializer_list<Key> &keys,
int delay = 100);
84 void RegisterTo(E_ &event,
bool ignoremodified =
false) {
105 registeredkeys.insert(key);
110 template<
class ... T_>
112 registeredkeys.insert(key);
114 this->
Register(std::forward<T_>(args)...);
124 registeredkeys.erase(key);
129 return registeredkeys.count(key) != 0;
141 return pressedkeys.count(key) != 0;
146 repeatonpress = value;
151 return repeatonpress;
156 repeatonrelease = value;
161 return repeatonrelease;
167 initialdelay = value;
190 acceleration = value;
202 accelerationstart = value;
208 return accelerationstart;
214 accelerationcount = value;
220 return accelerationcount;
225 return delay - accelerationcount * acceleration;
233 virtual bool Progress(
unsigned &)
override;
256 internal::eventunregisterhelper *token =
nullptr;
258 std::map<Key, repeatinfo> pressedkeys;
260 std::set<Key> registeredkeys;
263 bool repeatonpress =
true;
265 bool repeatonrelease =
false;
267 int initialdelay = 500;
271 int acceleration = 0;
273 int accelerationcount = 0;
275 int accelerationstart = 0;
277 unsigned lastprogress = 0;
intptr_t EventToken
Generic type to store event tokens.
Definition: Event.h:121
Base(ControllerBase &controller)
Sets the controller for this animation to the given controller.
Definition: Animation.h:310
This class provides event mechanism.
Definition: Event.h:134
virtual unsigned GetProgress() const =0
Returns the current progress of the timer.
Controllers are required to progress animations.
Definition: Animation.h:65
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
This is the base class for all animations.
Definition: Animation.h:306
virtual void SetController(ControllerBase &controller)
Sets the controller to the given controller.
Definition: Animation.h:334
ControllerBase * controller
Controller of this animation.
Definition: Animation.h:388