diff options
| author | Paul Gilbert | 2019-03-02 19:35:36 -0800 | 
|---|---|---|
| committer | Paul Gilbert | 2019-03-02 19:35:36 -0800 | 
| commit | 8393faf036e07f8844ee01e94173da5cdcbb7f77 (patch) | |
| tree | f7d144a5dae7e3ac2aeea6b78d30bb8ecde7b94e | |
| parent | 3b8d006c8b7091f6e65a4c4865cc9aebb6452d38 (diff) | |
| download | scummvm-rg350-8393faf036e07f8844ee01e94173da5cdcbb7f77.tar.gz scummvm-rg350-8393faf036e07f8844ee01e94173da5cdcbb7f77.tar.bz2 scummvm-rg350-8393faf036e07f8844ee01e94173da5cdcbb7f77.zip | |
GLK: Switch focus window immediately after requesting lines or chars
| -rw-r--r-- | engines/glk/window_text_buffer.cpp | 20 | ||||
| -rw-r--r-- | engines/glk/window_text_buffer.h | 8 | ||||
| -rw-r--r-- | engines/glk/window_text_grid.cpp | 20 | ||||
| -rw-r--r-- | engines/glk/window_text_grid.h | 10 | 
4 files changed, 45 insertions, 13 deletions
| diff --git a/engines/glk/window_text_buffer.cpp b/engines/glk/window_text_buffer.cpp index 788f8caea5..2638302e62 100644 --- a/engines/glk/window_text_buffer.cpp +++ b/engines/glk/window_text_buffer.cpp @@ -653,6 +653,9 @@ void TextBufferWindow::requestLineEvent(char *buf, uint maxlen, uint initlen) {  	if (g_vm->gli_register_arr)  		_inArrayRock = (*g_vm->gli_register_arr)(buf, maxlen, "&+#!Cn"); + +	// Switch focus to the new window +	_windows->inputGuessFocus();  }  void TextBufferWindow::requestLineEventUni(uint32 *buf, uint maxlen, uint initlen) { @@ -707,6 +710,23 @@ void TextBufferWindow::requestLineEventUni(uint32 *buf, uint maxlen, uint initle  	if (g_vm->gli_register_arr)  		_inArrayRock = (*g_vm->gli_register_arr)(buf, maxlen, "&+#!Iu"); + +	// Switch focus to the new window +	_windows->inputGuessFocus(); +} + +void TextBufferWindow::requestCharEvent() { +	_charRequest = true; + +	// Switch focus to the new window +	_windows->inputGuessFocus(); +} + +void TextBufferWindow::requestCharEventUni() { +	_charRequestUni = true; + +	// Switch focus to the new window +	_windows->inputGuessFocus();  }  void TextBufferWindow::cancelLineEvent(Event *ev) { diff --git a/engines/glk/window_text_buffer.h b/engines/glk/window_text_buffer.h index 0ac74d2e2a..9020c1a871 100644 --- a/engines/glk/window_text_buffer.h +++ b/engines/glk/window_text_buffer.h @@ -220,13 +220,9 @@ public:  	virtual void getSize(uint *width, uint *height) const override; -	virtual void requestCharEvent() override { -		_charRequest = true; -	} +	virtual void requestCharEvent() override; -	virtual void requestCharEventUni() override { -		_charRequestUni = true; -	} +	virtual void requestCharEventUni() override;  	virtual void setEchoLineEvent(uint val) override {  		_echoLineInput = val != 0; diff --git a/engines/glk/window_text_grid.cpp b/engines/glk/window_text_grid.cpp index e0459e0b2e..226b2f1acd 100644 --- a/engines/glk/window_text_grid.cpp +++ b/engines/glk/window_text_grid.cpp @@ -265,6 +265,9 @@ void TextGridWindow::requestLineEvent(char *buf, uint maxlen, uint initlen) {  	if (g_vm->gli_register_arr)  		_inArrayRock = (*g_vm->gli_register_arr)(buf, maxlen, "&+#!Cn"); + +	// Switch focus to the new window +	_windows->inputGuessFocus();  }  void TextGridWindow::requestLineEventUni(uint32 *buf, uint maxlen, uint initlen) { @@ -317,6 +320,23 @@ void TextGridWindow::requestLineEventUni(uint32 *buf, uint maxlen, uint initlen)  	if (g_vm->gli_register_arr)  		_inArrayRock = (*g_vm->gli_register_arr)(buf, maxlen, "&+#!Iu"); + +	// Switch focus to the new window +	_windows->inputGuessFocus(); +} + +void TextGridWindow::requestCharEvent() { +	_charRequest = true; + +	// Switch focus to the new window +	_windows->inputGuessFocus(); +} + +void TextGridWindow::requestCharEventUni() { +	_charRequestUni = true; + +	// Switch focus to the new window +	_windows->inputGuessFocus();  }  void TextGridWindow::cancelLineEvent(Event *ev) { diff --git a/engines/glk/window_text_grid.h b/engines/glk/window_text_grid.h index f5568cd24f..de64ab3801 100644 --- a/engines/glk/window_text_grid.h +++ b/engines/glk/window_text_grid.h @@ -171,9 +171,9 @@ public:  	virtual void getSize(uint *width, uint *height) const override; -	virtual void requestCharEvent() override { -		_charRequest = true; -	} +	virtual void requestCharEvent() override; + +	virtual void requestCharEventUni() override;  	/**  	 * Prepare for inputing a line @@ -197,10 +197,6 @@ public:  		_mouseRequest = false;  	} -	virtual void requestCharEventUni() override { -		_charRequestUni = true; -	} -  	virtual void requestMouseEvent() override {  		_mouseRequest = true;  	} | 
