Commit Graph

104 Commits

Author SHA1 Message Date
Bastien Bouclet
85e3fb38fb SDL: Change keyboard repeat to apply on unmapped events
The keyboard repeat event generator is used when building against SDL1.
Previously the repeat events would generate based on the event stream
produced by the keymapper which is not guaranteed to have matching up
and down events in the case the keymaps are changed while a key is
pressed.

Fixes #11417.
2020-04-12 11:11:00 +02:00
Bastien Bouclet
9cc2fee887 SDL: Enable joystick input by default
Game controller input is now enabled whenever a compatible device is
connected. The keymapper's keymaps are refreshed when a joystick is added
or removed.

Fixes #10366.
2020-03-16 18:41:27 +01:00
Bastien Bouclet
568d882e80 KEYMAPPER: Introduce a Virtual Mouse event source
The Virtual Mouse is meant to provide a way to control the mouse cursor
on system without a physical mouse. It provides keymapper actions that
are expected to be bound to game controller axes or buttons.
2020-03-09 20:00:31 +01:00
Bastien Bouclet
e66e35a3fd COMMON: Move isMouseEvent from Keymapper to Common 2020-03-09 20:00:31 +01:00
Cameron Cawley
1605b72ee8 BACKENDS: Add events for additional mouse buttons 2020-02-26 21:34:24 +01:00
Bastien Bouclet
22c75c644a EVENTS: Change DefaultEventManager to be the owner of the keymapper 2020-02-22 13:14:04 +02:00
lolbot-iichan
7edaf3f2f7 KEYMAPPER: Enable remapping of the mouse wheel 2020-02-19 08:04:25 +02:00
Paul Gilbert
818d9bab27 ENGINES: Change debugger trigger to Ctrl+Alt+D using keymapper 2020-02-16 13:07:19 +02:00
Bastien Bouclet
2177e685b7 KEYMAPPER: Allow joystick half axes to be remapped 2020-02-09 08:34:16 -06:00
rsn8887
eea70a3c8c BACKEND: Allow SDL2 mapping of L2/R2, fix psp2/switch mapping 2020-02-09 08:34:16 -06:00
Bastien Bouclet
e973092aef KEYMAPPER: Enable remapping of the mouse buttons 2020-01-29 08:51:29 +01:00
Bastien Bouclet
32174c9067 KEYMAPPER: Actions can now be bound to joystick buttons 2020-01-29 08:51:29 +01:00
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
14663c4790 KEYMAPPER: Make the keymapper mandatory 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
511d138bbc KEYMAPPER: Move the remap dialog to an option dialog tab
The aim is to make it easy to discover, and possible to use without a
keyboard.
2020-01-26 23:09:08 +02:00
Bastien Bouclet
8dd2b7ca39 EVENTS: Expose the primary global keymap builder 2020-01-26 23:09:08 +02:00
Bastien Bouclet
7edff01e69 KEYMAPPER: Move the remap event capture logic out of the keymapper 2020-01-26 19:07:53 +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
Cameron Cawley
7bf22fa996 BACKENDS: Add EVENT_CLIPBOARD_UPDATE event 2019-09-21 22:16:01 +03:00
D G Turner
2d1b4dc977 COMMON: Add Default Values for Joystick State Structure
This ensures that this has a defined value when used without the
engine needing to set the field values directly i.e. as per CGE.
2019-07-24 22:00:26 +01:00
jepael
3b68380ca3 SDL: Fix compiler warning and joystick event handling 2019-07-13 09:15:41 +03:00
Cameron Cawley
30109816fe SDL: Initial implementation of joystick events 2019-07-08 01:24:55 +03:00
Cameron Cawley
d7b2b1b8f9 GUI: Support adding games via Drag and Drop 2019-04-30 22:17:04 +01:00
Bastien Bouclet
acf87add27 COMMON: Improve spacing between members in the event structs 2017-11-19 20:16:10 +01:00
Bastien Bouclet
8beb519c5e EVENTS: Rename synthetic to kbdRepeat 2017-11-19 16:12:50 +01:00
Colin Snover
d1b77d4b68 BACKENDS: Fix missing mouse events when system cursor cannot be moved
Normally with SDL, a mouse motion event will be sent after the
system mouse cursor has been moved by a call to
SDL_WarpMouseInWindow, but if the system cursor cannot be moved
(e.g. because the window does not have mouse focus), games still
need to receive these mouse events so they can successfully update
the mouse position internally. Otherwise, games continue to think
the mouse is still in the original position and will continue to
try to perform whatever action is associated with that mouse
position.

Refs Trac#9689.
2017-10-15 13:24:21 -05:00
Thierry Crozat
b8142ff362 COMMON: Add method in EventManager to clear the event queue 2017-07-26 21:39:31 +01:00
Einar Johan Trøan Sømåen
b7c5ce879f COMMON: Fix some Doxygen comments that seem wrong. 2014-08-29 03:28:00 +02:00
Johannes Schickel
854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01: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
d12f21b31d KEYMAPPER: Map non-key custom input events
This also makes the keymapper be in charge of keymapping logic
2012-03-02 20:48:50 -06:00
Tarek Soliman
533f80282b KEYMAPPER: Rename EVENT_CUSTOM_BACKEND to EVENT_CUSTOM_BACKEND_ACTION 2012-02-27 13:04:59 -06:00
Tarek Soliman
6b91c94a09 KEYMAPPER: Initialize Event::customType 2012-02-22 07:04:59 -06:00
Tarek Soliman
3f6d549b0e KEYMAPPER: Move F7 and F8 handling to DefaultEventMapper 2012-02-20 06:49:22 -06:00
Tarek Soliman
3c918bb378 KEYMAPPER: Move DefaultEventMapper implementation to its own cpp file 2012-02-20 06:49:22 -06:00
Tarek Soliman
a0ba4eb569 KEYMAPPER: Rewrite the EventMapper API 2012-02-20 06:49:22 -06:00
Tarek Soliman
5c3e48fddf KEYMAPPER: Create a DefaultEventMapper when Keymapper isn't enabled
This allows migration to unconditional mapping
2012-02-20 06:49:22 -06:00
Tarek Soliman
f608b94a5d COMMON: Fix value of EVENT_CUSTOM_BACKEND
I failed to see that the enum was not ordered
2012-02-18 22:23:06 -06:00
Johannes Schickel
d127843859 COMMON: Enable backend specific custom events only when the Keymapper is enabled.
Otherwise there is no way of generating these events, thus it's better to make
people really aware of this.

I furthermore added some nots that its part of a WIP API, thus it should only
be used after checking up.
2012-02-13 01:23:07 +01:00
Tarek Soliman
883f9ae073 COMMON: Add custom backend event 2012-02-12 13:28:13 -06:00
Tarek Soliman
718e106a31 COMMON: Fix comment typo 2012-02-02 18:10:08 -06:00
Eugene Sandulenko
1d50a31830 RECORDER: Give name to recoder priority. Added middle button storing. 2011-08-08 20:01:09 +01: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
Matthew Hoops
9539017ee3 ALL: initialise -> initialize 2011-05-25 11:17:11 -04:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00