diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-11-17 17:35:07 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-11-17 17:35:07 +0000 |
commit | 4a0804396809345423d596b079aed51261b8612f (patch) | |
tree | 60a137a4d5ab8a246c2ad6303691f5eb1ab426b4 /src | |
parent | df0a8e7c62a4006ea7ac66ad7c0745a48a32ef24 (diff) | |
download | usdx-4a0804396809345423d596b079aed51261b8612f.tar.gz usdx-4a0804396809345423d596b079aed51261b8612f.tar.xz usdx-4a0804396809345423d596b079aed51261b8612f.zip |
prevent key input from being sent to the screen that is fading out, send it to the screen that is fading in instead.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1946 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r-- | src/base/UMain.pas | 2 | ||||
-rw-r--r-- | src/menu/UDisplay.pas | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/base/UMain.pas b/src/base/UMain.pas index b8ddf346..439b0faa 100644 --- a/src/base/UMain.pas +++ b/src/base/UMain.pas @@ -514,7 +514,7 @@ begin else begin // check if screen wants to exit - Done := not Display.CurrentScreen^.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true); + Done := not Display.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true); // if screen wants to exit if Done then diff --git a/src/menu/UDisplay.pas b/src/menu/UDisplay.pas index 6f29d2e1..81056c13 100644 --- a/src/menu/UDisplay.pas +++ b/src/menu/UDisplay.pas @@ -91,6 +91,9 @@ type function Draw: boolean; + { calls ParseInput of cur or next Screen if assigned } + function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown : boolean): boolean; + { sets SDL_ShowCursor depending on options set in Ini } procedure SetCursor; @@ -505,6 +508,16 @@ begin end; end; +function TDisplay.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown : boolean): boolean; +begin + if (assigned(NextScreen)) then + Result := NextScreen^.ParseInput(PressedKey, CharCode, PressedDown) + else if (assigned(CurrentScreen)) then + Result := CurrentScreen^.ParseInput(PressedKey, CharCode, PressedDown) + else + Result := True; +end; + procedure TDisplay.SaveScreenShot; var Num: integer; |