Opened 12 months ago

Last modified 4 weeks ago

#14694 new defect

SCI: QFG4: Missing undocumented keystrokes: Alt+NumPad 3 and Alt+NumPad9

Reported by: CaneCraft Owned by:
Priority: low Component: Engine: SCI
Version: Keywords:
Cc: Game: Quest for Glory 4

Description (last modified by CaneCraft)

Information

Quest for Glory IV has a few undocumented keystrokes that do not work on the ScummVM version. These must be input by holding Alt, pressing a button, and releasing Alt.

Alt + NumPad 3 | Should open the main menu (same as pressing Ctrl+C)
Alt + NumPad 9 | Should open the inventory (same as pressing Tab)

The latter is fairly irrelevant, but the former is used by speedrunners.

Version

ScummVM 2.8.0git9303-gc59521f979f (Nov 13 2023 22:16:27)

Change History (3)

comment:1 by CaneCraft, 12 months ago

Description: modified (diff)

comment:2 by sluicebox, 12 months ago

How did you find out that these key combinations worked?

These are ALT codes, not QFG4 shortcuts. ALT codes were a IBM BIOS feature that Windows also implements for entering arbitrary characters by number: https://en.wikipedia.org/wiki/Alt_code

For example, ALT+65 prints a capital A, because 'A' is character code 65.

In this case, characters 3 and 9 triggered QFG4 functionality. I have no idea how, that sounds like a bug in Sierra's interpreter that's translating them incorrectly through the event layers. I am confident that no QFG4 developer intended that to work. We can see in the decompiled scripts that they are only listening for Ctrl+C or Tab; there was no second set of shortcuts. https://github.com/sluicebox/sci-scripts/blob/e2b933ded8540cc1d4d09c0153331abc3bc67a5b/qfg4-cd-dos-1.0/src/Main.sc#L1673

That implies that this worked by accident because character codes 3 and 9 happen to turn into SCI event messages 17 and 22.

I'm not saying it can't be done, but it was an unintentional feature and I don't know if we're capable of implementing given that we've got the SDL layer to go through on top of everything, and we're talking about characters that can't be typed.

To implement this you'd have to:

  1. Figure out what Sierra's keyboard driver and exe were doing to produce event code 17 from character code 3
  2. Figure out how to reproduce that in kGetEvent
  3. Figure out if we can get character codes 3 and 9 through all the SDL/ScummVM layers to the SCI engine code

Sounds hard!

comment:3 by tag2015, 4 weeks ago

Summary: Missing undocumented keystrokes: Alt+NumPad 3 and Alt+NumPad9SCI: QFG4: Missing undocumented keystrokes: Alt+NumPad 3 and Alt+NumPad9
Note: See TracTickets for help on using tickets.