diff options
| -rwxr-xr-x | engines/pegasus/input.cpp | 8 | ||||
| -rwxr-xr-x | engines/pegasus/input.h | 7 | ||||
| -rw-r--r-- | engines/pegasus/pegasus.cpp | 6 | 
3 files changed, 20 insertions, 1 deletions
| diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp index 76f5afae63..08bc22bafd 100755 --- a/engines/pegasus/input.cpp +++ b/engines/pegasus/input.cpp @@ -43,6 +43,7 @@ void InputDevice::getInput(Input &input, const tInputBits filter) {  	// TODO: Save/Load keys  	tInputBits currentBits = 0; +	bool consoleRequested = false;  	Common::Event event;  	while (g_system->getEventManager()->pollEvent(event)) { @@ -94,6 +95,10 @@ void InputDevice::getInput(Input &input, const tInputBits filter) {  			case Common::KEYCODE_DELETE:  				currentBits |= (kRawButtonDown << kRightFireButtonShift);  				break; +			case Common::KEYCODE_d: +				if (event.kbd.flags & Common::KBD_CTRL) // Console! +					consoleRequested = true; +				break;  			default:  				break;  			} @@ -119,6 +124,9 @@ void InputDevice::getInput(Input &input, const tInputBits filter) {  	// Update the last bits  	_lastRawBits = currentBits; + +	// Set the console to be requested or not +	input.setConsoleRequested(consoleRequested);  }  //	Wait until the input device stops returning input allowed by filter... diff --git a/engines/pegasus/input.h b/engines/pegasus/input.h index 06724346e5..d70a573bc0 100755 --- a/engines/pegasus/input.h +++ b/engines/pegasus/input.h @@ -353,19 +353,24 @@ public:  	void getInputLocation(Common::Point &where) const { where = _inputLocation; }  	bool anyInputBitSet(const tInputBits bits) const { return (_inputState & bits) != 0; } -	 + +	bool isConsoleRequested() const { return _consoleRequested; } +  	void clearInput() {  		_inputState = kAllUpBits;  		_inputLocation.x = 0;  		_inputLocation.y = 0; +		_consoleRequested = false;  	}  protected:  	void setInputBits(const tInputBits state) { _inputState = state; }  	void setInputLocation(const Common::Point &where) { _inputLocation = where; } +	void setConsoleRequested(bool consoleRequested) { _consoleRequested = consoleRequested; }  	tInputBits _inputState;  	Common::Point _inputLocation; +	bool _consoleRequested;  };  class InputHandler { diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp index f12513601a..5870854ed9 100644 --- a/engines/pegasus/pegasus.cpp +++ b/engines/pegasus/pegasus.cpp @@ -604,6 +604,12 @@ void PegasusEngine::handleInput(const Input &input, const Hotspot *cursorSpot) {  	if (!checkGameMenu())  		; // TODO: Other input +	// Handle the console here +	if (input.isConsoleRequested()) { +		_console->attach(); +		_console->onFrame(); +	} +  	// TODO: Quit request  	// TODO: Save request  	// TODO: Load request | 
