[Scummvm-cvs-logs] CVS: scummvm/saga interface.cpp,1.107,1.108 interface.h,1.60,1.61

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Tue Jun 21 11:06:20 CEST 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7199

Modified Files:
	interface.cpp interface.h 
Log Message:
When a key is pressed, go back to repeat phase 0 again. This is so that we
won't continue a fast repeat with the new key. (Annoying example: It could
be tricky to type upper-case letters because if you didn't type the letter
fast enough "Shift" would begin to repeat, and then whatever letter you
typed would start repeating immediately.)


Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- interface.cpp	19 Jun 2005 23:41:40 -0000	1.107
+++ interface.cpp	21 Jun 2005 15:41:35 -0000	1.108
@@ -279,15 +279,15 @@
 
 	_panelMode = mode;
 	
-	switch(_panelMode) {
-		case(kPanelMain):
+	switch (_panelMode) {
+		case kPanelMain:
 			_mainPanel.currentButton = NULL;
 			break;
-		case(kPanelConverse):
+		case kPanelConverse:
 			_conversePanel.currentButton = NULL;
 			converseDisplayText();
 			break;
-		case(kPanelOption):
+		case kPanelOption:
 			_optionPanel.currentButton = NULL;
 			_vm->fillSaveList();
 			calcOptionSaveSlider();
@@ -295,13 +295,13 @@
 				_optionSaveFileTitleNumber = _vm->getDisplayInfo().optionSaveFileVisible - 1;
 			}
 			break;
-		case(kPanelLoad):
+		case kPanelLoad:
 			_loadPanel.currentButton = NULL;
 			break;
-		case(kPanelQuit):
+		case kPanelQuit:
 			_quitPanel.currentButton = NULL;
 			break;
-		case(kPanelSave):
+		case kPanelSave:
 			_savePanel.currentButton = NULL;
 			_textInputMaxWidth = _saveEdit->width - 10;
 			_textInput = true;
@@ -314,9 +314,11 @@
 	draw();
 }
 
-bool Interface::processAscii(uint16 ascii) {
+bool Interface::processAscii(uint16 ascii, bool synthetic) {
 	int i;
 	PanelButton *panelButton;
+	if (!synthetic)
+		_textInputRepeatPhase = 0;
 	if (_statusTextInput) {
 		processStatusTextInput(ascii);
 		return true;
@@ -450,6 +452,7 @@
 void Interface::textInputStartRepeat(uint16 ascii) {
 	if (!_textInputRepeatPhase) {
 		_textInputRepeatPhase = 1;
+		Common::g_timer->removeTimerProc(&textInputRepeatCallback);
 		Common::g_timer->installTimerProc(&textInputRepeatCallback, KEYBOARD_REPEAT_DELAY1, this);
 	}
 
@@ -462,7 +465,7 @@
 		Common::g_timer->removeTimerProc(&textInputRepeatCallback);
 		Common::g_timer->installTimerProc(&textInputRepeatCallback, KEYBOARD_REPEAT_DELAY2, this);
 	} else if (_textInputRepeatPhase == 2) {
-		processAscii(_textInputRepeatChar);
+		processAscii(_textInputRepeatChar, true);
 	}
 }
 

Index: interface.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.h,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- interface.h	19 Jun 2005 23:41:40 -0000	1.60
+++ interface.h	21 Jun 2005 15:41:35 -0000	1.61
@@ -227,7 +227,7 @@
 	void drawStatusBar();
 	void setVerbState(int verb, int state);
 
-	bool processAscii(uint16 ascii);
+	bool processAscii(uint16 ascii, bool synthetic = false);
 	void processKeyUp(uint16 ascii);
 
 	bool _textInput;





More information about the Scummvm-git-logs mailing list