Commit Graph
95 Commits
Author SHA1 Message Date
sluicebox a2cc90bf9b SCI: Fix backend events treated as keyboard events
Prevents backend events such as EVENT_SCREEN_CHANGED
from being misinterpreted as SCI keyboard events
2019-06-06 07:08:49 +03:00
Adrian Frühwirth a20f90cbb7 JANITORIAL: Fix formatting 2018-04-22 00:56:21 +02:00
Colin Snover c7c5f28bdb SCI32: Clean up scriptWidth/scriptHeight/screenWidth/screenHeight
This removes the unnecessary Buffer subclass and stops most places
where the output buffer was being interrogated about dimensions
instead of GfxFrameout.
2017-10-06 22:56:26 -05:00
Colin Snover 7a41b6f023 SCI: Add support for keyup events
Basic keyup event support appears to have been added in the SCI1.1
IBM keyboard driver, and more robust support was provided in SCI32
which actually gets used by at least Lighthouse. This patch adds
support for keyup events in SCI1.1+.

Fixes Trac#10242.
2017-09-27 20:27:34 -05:00
Colin Snover 9a8070da3c SCI: Do some clean-up of event handling system
Convert macros and vars to enums, rename keyboard events in
preparation for adding key up events, clean up unnecessary nested
conditionals, add TODOs for potential future work.
2017-09-27 20:27:33 -05:00
Colin Snover 0beb259278 SCI32: Improve performance when flushing events during video playback
Calling through EventManager::getSciEvent to flush events is
pretty inefficient and created stalls that lead to dropped
frames during the chapter 7 chase in Phantasmagoria 1.

If necessary, performance could be improved further by extending
Common::EventManager to expose SDL_FlushEvents, but this seems to
finish in 0-1ms so should be OK for now.

Refs Trac#9974, Trac#9975.
2017-07-23 10:35:13 -05:00
Colin Snover b4c0be8b42 SCI: Fix control character keyboard events
Used by:

* All games with text inputs (Ctrl+C clears text boxes)
* QFG1VGA (Ctrl+S shows stats)
* Torin (Ctrl+N, Ctrl+O, Ctrl+S, etc. activate menu commands)

The branch that used to shift control keys for SCI versions <=
SCI_VERSION_1_MIDDLE was bogus; history indicates it was intended
to be used to fix backends that sent control characters when
Ctrl+Alt were used together, but that case is already handled by
the Alt-checking code just prior to that code. Games expect to
receive control characters only when Ctrl is the only active
modifier, and this seems to be consistent across all versions of
SCI engine from SCI0 all the way through at least SCI2.1.

Fixes Trac#6703, Trac#9837.
2017-07-16 01:33:57 -05:00
Colin Snover 6303468555 SCI32: Fix mouse position clamping 2016-10-14 19:52:21 -05:00
Colin Snover c118e2fe12 SCI32: Reset active hot rect index when changing hot rects 2016-10-10 19:35:28 -05:00
Colin Snover 1c5a5d09f9 SCI32: Fix Return to Launcher in F5 menu
Closes #837.
2016-10-05 15:30:31 -05:00
Colin Snover 44dd029cb1 SCI32: Implement kSetHotRectangles
Used only by chapter 7 of Phant1.
2016-09-29 19:39:16 -05:00
Colin Snover 560af83300 SCI: Move SciEngine::sleep to correct source file 2016-09-29 19:39:16 -05:00
Colin Snover d0517f515e SCI32: Update screen on frameout, instead of in the event loop 2016-09-29 19:39:16 -05:00
Colin Snover 80d9182554 SCI32: Implement SCI32 cursor support 2016-08-19 13:57:40 -05:00
Colin Snover 77991b7eac SCI32: Add const to getCurrentBuffer 2016-07-02 22:28:41 -05:00
Colin Snover 1337cd3dec SCI32: Implement kEditText 2016-03-06 21:34:43 -06:00
Filippos Karapetis cdbd7c8add SCI: Use uint32 instead of unsigned int 2016-03-01 01:12:58 +02:00
Johannes Schickel 60d4367f3c SCI: Formatting fix. 2016-02-13 00:36:06 +01:00
Johannes Schickel 98edaa799e SCI: Make variable name in line with our guidelines.
(cherry picked from commit 7d7c36b593)
2016-02-13 00:06:27 +01:00
Johannes Schickel 82b5ed65cc SCI: Small variable renaming to match our naming guidelines. 2016-02-09 19:52:09 +01:00
Johannes Schickel b911976a66 SCI: Take advantage of operator-> of Common::List::iterator. 2016-02-09 16:42:45 +01:00
Martin Kiewitz e91bdf0262 SCI: Remove hardcoded value in getScummVMEvent() 2016-02-03 20:45:08 +01:00
Martin Kiewitz 7635f3c73e SCI: Make event handling helper tables static 2016-02-02 15:03:54 +01:00
Martin Kiewitz b052ff2762 SCI: Fix comment about debugger keys
Was changed to Ctrl-Shift-D at some point, because a SCI game
uses Ctrl-D. Comment wasn't changed accordingly back then.
2016-02-02 12:51:25 +01:00
Martin Kiewitz 42cb01f57c SCI: Keyboard event handling cleanup
Renamed "ourModifiers" to "scummVMKeyFlags"
Now also using the flags directly from the ScummVM event in case
it actually was a Keyboard event.
2016-02-02 12:47:47 +01:00
Martin Kiewitz bc0dd6f821 SCI: Fix regression of previous keycode commit
7aeadba863
Thanks LordHoto for spotting it
2016-02-02 11:43:58 +01:00
Martin Kiewitz 7aeadba863 SCI: Removed ".data" from SciEvent
Was the ScummVM-system-Keycode, sometimes modified.
Changed Menu/Portrait/Controls32-code to use .character instead.
Cleaned up a bit of code in getScummVMEvent()
2016-02-02 11:33:40 +01:00
Martin Kiewitz 82a27a33da SCI: fix typo in comment 2016-02-02 10:46:16 +01:00
Martin Kiewitz 59d2c4b27e SCI: Do not pass/use .data for mouse button type
Also added comment about .data field. Should be renamed.
2016-02-02 02:10:43 +01:00
Martin Kiewitz c0bdbe1ca8 SCI: Fix control/Fx keys not working anymore
Was effectively caused by commit adding the keyboard driver bug
for SCI0/SCI01, although the bug is actually real and happens.

It seems Sierra did not check the key-modifier in kMenuSelect.
We do and that's why the code didn't recognize all sorts of
menu keys anymore.
We now isolate the lower byte before comparing.

I also noticed, that Sierra passed keyboard modifiers in mouse
events. This was probably done, so that owners of a 1-button
mouse were able to right-click. We do this now too.

Also added information about mouse modifiers in kGetEvent.

Moved the mouse modifier code into getScummVMEvent().

This should fix bug #7009.
2016-02-02 01:56:08 +01:00
Martin Kiewitz 0b17a67a30 SCI: Revert revert the keyboard handling changes
It seems the issues on AmigaOS aren't actually caused by the new
code. Reverting the revert.
2016-02-01 15:04:03 +01:00
Martin Kiewitz a3774072a3 SCI: Revert ascii detection for key event handling
Seems to cause at least issues on AmigaOS probably b/c SDL.
See bug #7009.
Added FIXME. Underlying issue needs to get fixed in SDL backend
or in SDL itself.
2016-02-01 02:09:12 +01:00
Martin Kiewitz 171b79c2c5 SCI: add code to make numpad cursor keys work again
When the users presses keys on the numpad, we get digits in .ascii
even when Num-Lock is not enabled. This caused numpad cursor keys
not working anymore. Imo we should only get .ascii in those cases,
when Num-Lock is enabled.
2016-01-29 22:57:30 +01:00
Martin Kiewitz fa66b823b8 SCI: change ascii detection for key event handling
New way is probably better. Sadly we get a few keys atm in the
ascii field, like cursor left and the function keys. That's why
a check for <= 0xFF is needed.
2016-01-28 20:19:34 +01:00
Filippos Karapetis 92bf8a5420 SCI: Fix bug #6703: "SCI: QFG1 VGA - Can't CTRL+S to access statistics"
This actually affected all Control+key combinations. A regression from
0f90b8eaad
2014-10-18 22:06:48 +03:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Johannes Schickel 45f95cbc8b SCI: Minor formatting fixes. 2013-01-14 21:07:20 +01:00
Lars Skovlund 8e733f03b7 SCI: Event handling: Include modifier flags in null events.
Fixes bug #3580473
2013-01-14 20:11:34 +01:00
Willem Jan Palenstijn 18dd5e5128 SCI: Fix mouse up events
Regression from 906f024831.
Fixes bug #3533069.
2012-06-08 08:31:06 +02:00
Filippos Karapetis 0f90b8eaad SCI: Allow alt key combinations in all SCI games
Such key combos are used for the game debugger in SCI1.1 and GK1
2011-10-29 20:39:39 +03:00
Max Horn 88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
Willem Jan Palenstijn 0da3f8d8a5 SCI: Fix probable alt/shift mixup
A check for alt was changed into this check for shift in the
cleanup commit 906f024831.
2011-05-21 16:02:51 +02:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
md5 51f733b2a6 SCI: Changed debug console hotkey to Control-Shift-D instead of Control-D.
Applied from patch #3258985.
The previous hotkey interfered with the hotkeys of some games (e.g.
the "time of day" hotkey in QFG2, bug #3250996).
2011-04-03 14:35:54 +03:00
Matthew Hoops 9a4e433f88 SCI: Fix mouse positions in upscaled games
A regression from 463e475bd6
2011-03-10 20:02:05 -05:00
md5 60bad3754b SCI: Fixed regression (shift key) in the latest event code cleanup 2011-03-10 03:11:23 +02:00
Johannes Schickel 463e475bd6 SCI: Save mouse position in SciEvent.
Instead of querying the event manager for the current mouse cursor coordinates
kGetEvent now uses the saved mouse positions, which will assure every event
will be processed with the correct coordinates instead of the current ones.
Various other functions using SciEvent directly were adapted too.

This fixes cursor click positions for the WinCE backend.

Thanks to wjp and waltervn for helping me with this.
2011-03-09 01:19:12 +01:00
md5 906f024831 SCI: Cleanup of the event code 2011-03-09 01:47:53 +02:00
md5 bd64c5078c SCI: Cleaned up kMapKeyToDir and removed an incorrect heuristic
The heuristic in question was used to detect the pseudo mouse control
functionality, however the change in controls seems to have occurred with the
transition to cursor views. Fixes keypad control in Conquest of the Longbow.
Moreover, the code also checked for key scan code 76 when checking for the middle
keypad button, which seems to be a mistake, as that case never occurred.
2011-02-15 15:46:15 +02:00
Filippos Karapetis ce9f7c0df1 SCI: Fixed keyboard input when numlock is on, and cleaned up the way some special keys are translated
svn-id: r54493
2010-11-26 10:03:24 +00:00