Commit Graph

24 Commits

Author SHA1 Message Date
Bastien Bouclet
df4bf6556c KEYMAPPER: Introduce custom engine actions
Custom engine actions are a new type of event the Keymapper can produce.
When an engine declares its keymap, it can declare it wants to receive
custom action events when the corresponding key is pressed, instead of
the originating hardware input events.

This system allows:
* Key bindings to be specified only once when declaring the keymap,
  instead of twice (when handling the events).
* To truly rebind keys in the keymaps dialog. When using traditional
  event mapping, the keymapper remaps the user keypress to the keypress
  expected by the game engine to perform the action. However, the engine
  still accepts the original keys.

The new concept of 'standard actions' defines a set of engine actions
that are commonly available in the games supported by ScummVM. Backends
can define default bindings for the standard actions to hardware
specific input devices.
2020-01-29 08:51:29 +01:00
Bastien Bouclet
ec9c394787 KEYMAPPER: Remove DefaultEventMapper
Now the keymapper is enabled by default, it does not make sense to have
a separate class anymore.
2020-01-29 08:51:29 +01:00
Bastien Bouclet
cc336635a1 KEYMAPPER: Change custom backend action events not to be instant
Allows action consumers to choose if they want to react on the start or
on the end of an user interaction.
2020-01-29 08:51:29 +01:00
Bastien Bouclet
2d7588d9c3 EVENTS: Remove the dependency to EventSource from EventMapper 2020-01-29 08:51:29 +01:00
Bastien Bouclet
63142d8090 COMMON: Event observers can't eat poll notifications anymore
It did not make much sense, and was unused.
2020-01-26 19:07:53 +01:00
Bastien Bouclet
955e18c648 COMMON: Use nullptr instead of NULL or 0 where appropriate 2018-05-10 08:35:46 +02:00
Thierry Crozat
013b09fa28 COMMON: Only clear events from the EventSources in clearEvents() 2017-07-27 21:05:43 +01:00
Thierry Crozat
b8142ff362 COMMON: Add method in EventManager to clear the event queue 2017-07-26 21:39:31 +01:00
Johannes Schickel
854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Filippos Karapetis
ecc43c9b92 Revert "COMMON: Fix crash when the keymapper and the event recorder are enabled"
This reverts commit 93987d999c.
2013-07-05 03:05:54 +03:00
Filippos Karapetis
93987d999c COMMON: Fix crash when the keymapper and the event recorder are enabled
DefaultEventManager registers a keymapper that is supposed to be
auto-freed. However, the event recorder then sets itself as a new
keymapper, but because the autofree flag is already set,
registerMapper() ends up deleting the event recorder itself. Setting
the autofree flag before actually freeing the mapper fixes the issue
and prevents ScummVM from crashing on startup
2013-07-05 02:56:12 +03:00
Johannes Schickel
71b031be12 COMMON: Initialize EventDispatcher::_autoFreeMapper.
This fixes a branching on uninitialized variable reported by valgrind on
startup.
2013-07-05 01:45:09 +02:00
Eugene Sandulenko
f59512c47e RECORDER: Implement Events Recorder 2013-05-17 00:18:09 +03:00
Tarek Soliman
c0a215282d KEYMAPPER: Add delays for *UP events coming from non-keys
Delayed entries are in a queue where each entry stores how
many milliseconds should pass based on the last entry.
2012-03-02 20:48:50 -06:00
Tarek Soliman
a0ba4eb569 KEYMAPPER: Rewrite the EventMapper API 2012-02-20 06:49:22 -06:00
Tarek Soliman
c0b04fdcaa KEYMAPPER: Having a mapper is no longer optional 2012-02-20 06:49:22 -06:00
Tarek Soliman
e7ade8ae05 KEYMAPPER: EventMapper must now eat all events 2012-02-20 06:49:21 -06:00
Eugene Sandulenko
a4029a8e94 RECORDER: Restore event recorder functionality.
It was badly broken after refactoring into EventObserver.

Fitst, deinit() method was never called which lead to bad record
files. Then, the concept of counting pollEvent() calls was ignored.

Introduced dispatchPoll() method of EventObserver which is implemented
in EventRecorder. It counts calls so is able to inject events at
more proper time.

Additionally now event times are recorded.
2011-08-08 20:01:07 +01:00
Christoph Mallon
84220d2ca0 COMMON: Remove superfluous Common:: qualifiers. 2011-08-07 15:19:07 +02:00
Christoph Mallon
23a0f5318c JANITORIAL: Remove trailing empty lines. 2011-08-07 13:53:33 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Torbjörn Andersson
72eb9ec9ea Fixed a bunch of cppcheck warnings. Mostly about checking if a pointer is null
before freeing it, which isn't necessary.

svn-id: r46941
2010-01-03 19:37:43 +00:00
Max Horn
f242266f6d Change a couple places from 'end of namespace' to 'End of namespace', for consistency
svn-id: r44634
2009-10-04 21:26:33 +00:00
Paul Gilbert
8e60e31db3 Changed the events.cpp file to EventDispatcher.cpp, to avoid MSVC name clashes with sdl/events.cpp
svn-id: r42790
2009-07-26 00:27:32 +00:00