Opened 14 years ago

Closed 14 years ago

Last modified 6 years ago

#4838 closed defect (fixed)

GUI: Text input + Right Alt

Reported by: SF/vgvgf Owned by: lordhoto
Priority: normal Component: GUI
Version: Keywords:
Cc: Game:


ScummVM version: 1.2.0svn Platform: Windows 7 32 bits

Details: When writting on the search box, if the right alt key is pressed while writting a character, the character will be repeated until another key is pressed.

Ticket imported from: #2978736. Ticket imported from: bugs/4838.

Change History (11)

comment:1 by fingolfin, 14 years ago

Summary: Text input + Right AltGUI: Text input + Right Alt

comment:2 by fingolfin, 14 years ago

Owner: set to Kirben

comment:3 by fingolfin, 14 years ago

I cannot reproduce this on my Mac OS X machine, neither on trunk nor on the 1.1 branch. Maybe because there is no dedicated right alt (aka "AltGr") key here?

Kirben, can you reproduce the issue?

comment:4 by Pidgeot, 14 years ago

Reproduced on Win7, 64-bit.

The problem is that in backends/platform/sdl/events.cpp, the key up event is explicitly swallowed when both Ctrl and Alt is held down - and since Ctrl+Alt is equivalent to AltGr, the event manager never realizes the character key has been released. This is, presumably, done because we didn't expect to ever have sent a down event - Ctrl+Alt is used for scaler hotkeys, and the event is handled in the backend.

I see two ways of fixing this: either pass on the up key event if we're not releasing one of the keys bound to a hotkey, or never send key down events when both Ctrl and Alt is held down.

The problem with never sending the key down event is that at least some games (such as LSL1SCI) can use a CTRL+ALT+<something> input - I can't think of any where it's *required* to play the game, but we would have to either provide a workaround (holding down a different set of modifier keys) or ignore that part - and it seems a little silly to require a workaround if it isn't really required.

In my opinion, it would be best to take the second option - look at the key being released and determine if it's a scaler hotkey. I've written a patch to do this and put it on Pastebin (since SourceForge won't let me attach it here):

I noticed that the GP2X backend also provides the handleScalerHotkey method, but it doesn't appear to get called anywhere - so I haven't attempted to do anything to that. I've only fixed the SDL backend.

comment:5 by lordhoto, 14 years ago

Please create an item on the patch tracker for your patch and append the patch as .patch file there too.

comment:6 by Pidgeot, 14 years ago

I've added it to the patch tracker as patch 2980597.

comment:7 by Kirben, 14 years ago

No, I can't reproduce this problem under ScummVM (branch or trunk), under Windows XP either.

comment:8 by Kirben, 14 years ago

Owner: Kirben removed

comment:9 by lordhoto, 14 years ago

Fixed by committing patch #2980597 "GSoC: GUI: Text input + Right Alt (bug #2978736)" by pidgeot.

comment:10 by lordhoto, 14 years ago

Owner: set to lordhoto
Resolution: fixed
Status: newclosed

comment:11 by digitall, 6 years ago

Component: GUI
Note: See TracTickets for help on using tickets.