[Scummvm-cvs-logs] scummvm master -> b5bb4125690e6277e001d0a1356ff50b2e361578

digitall digitall at scummvm.org
Wed Jun 8 05:26:07 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b5bb412569 AGI: Numeric Keypad Control in Predictive Dialog (Bug #3309376)


Commit: b5bb4125690e6277e001d0a1356ff50b2e361578
    https://github.com/scummvm/scummvm/commit/b5bb4125690e6277e001d0a1356ff50b2e361578
Author: D G Turner (digitall at scummvm.org)
Date: 2011-06-07T20:16:54-07:00

Commit Message:
AGI: Numeric Keypad Control in Predictive Dialog (Bug #3309376)

In AGI games, the numeric keypad is used as an alias for cursor keys to
allow stationary and 8 directional input, but while the predictive
dialog is open, this is more sensibly mapped to numeric input to
allow use of the predictive input on desktop ports.

Changed paths:
    engines/agi/agi.cpp



diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 7831658..811a58f 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -131,46 +131,65 @@ void AgiEngine::processEvents() {
 			switch (key = event.kbd.keycode) {
 			case Common::KEYCODE_LEFT:
 			case Common::KEYCODE_KP4:
-				if (_allowSynthetic || !event.synthetic)
+				if (_predictiveDialogRunning && key == Common::KEYCODE_KP4)
+					key = event.kbd.ascii;
+				else if (_allowSynthetic || !event.synthetic)
 					key = KEY_LEFT;
 				break;
 			case Common::KEYCODE_RIGHT:
 			case Common::KEYCODE_KP6:
-				if (_allowSynthetic || !event.synthetic)
+				if (_predictiveDialogRunning && key == Common::KEYCODE_KP6)
+					key = event.kbd.ascii;
+				else if (_allowSynthetic || !event.synthetic)
 					key = KEY_RIGHT;
 				break;
 			case Common::KEYCODE_UP:
 			case Common::KEYCODE_KP8:
-				if (_allowSynthetic || !event.synthetic)
+				if (_predictiveDialogRunning && key == Common::KEYCODE_KP8)
+					key = event.kbd.ascii;
+				else if (_allowSynthetic || !event.synthetic)
 					key = KEY_UP;
 				break;
 			case Common::KEYCODE_DOWN:
 			case Common::KEYCODE_KP2:
-				if (_allowSynthetic || !event.synthetic)
+				if (_predictiveDialogRunning && key == Common::KEYCODE_KP2)
+					key = event.kbd.ascii;
+				else if (_allowSynthetic || !event.synthetic)
 					key = KEY_DOWN;
 				break;
 			case Common::KEYCODE_PAGEUP:
 			case Common::KEYCODE_KP9:
-				if (_allowSynthetic || !event.synthetic)
+				if (_predictiveDialogRunning && key == Common::KEYCODE_KP9)
+					key = event.kbd.ascii;
+				else if (_allowSynthetic || !event.synthetic)
 					key = KEY_UP_RIGHT;
 				break;
 			case Common::KEYCODE_PAGEDOWN:
 			case Common::KEYCODE_KP3:
-				if (_allowSynthetic || !event.synthetic)
+				if (_predictiveDialogRunning && key == Common::KEYCODE_KP3)
+					key = event.kbd.ascii;
+				else if (_allowSynthetic || !event.synthetic)
 					key = KEY_DOWN_RIGHT;
 				break;
 			case Common::KEYCODE_HOME:
 			case Common::KEYCODE_KP7:
-				if (_allowSynthetic || !event.synthetic)
+				if (_predictiveDialogRunning && key == Common::KEYCODE_KP7)
+					key = event.kbd.ascii;
+				else if (_allowSynthetic || !event.synthetic)
 					key = KEY_UP_LEFT;
 				break;
 			case Common::KEYCODE_END:
 			case Common::KEYCODE_KP1:
-				if (_allowSynthetic || !event.synthetic)
+				if (_predictiveDialogRunning && key == Common::KEYCODE_KP1)
+					key = event.kbd.ascii;
+				else if (_allowSynthetic || !event.synthetic)
 					key = KEY_DOWN_LEFT;
 				break;
 			case Common::KEYCODE_KP5:
-				key = KEY_STATIONARY;
+				if (_predictiveDialogRunning)
+					key = event.kbd.ascii;
+				else 
+					key = KEY_STATIONARY;
 				break;
 			case Common::KEYCODE_PLUS:
 				key = '+';






More information about the Scummvm-git-logs mailing list