aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/windows.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2018-12-28 21:15:50 -0800
committerPaul Gilbert2018-12-28 21:15:50 -0800
commit7a21e236035876c8ae581d4f9d61584c6385b89a (patch)
tree64adffd16ae97d040f73bdf688726f0dc48c0676 /engines/glk/windows.cpp
parentf218400d3b75ee1cf537e2ca9db23bc417475c10 (diff)
downloadscummvm-rg350-7a21e236035876c8ae581d4f9d61584c6385b89a.tar.gz
scummvm-rg350-7a21e236035876c8ae581d4f9d61584c6385b89a.tar.bz2
scummvm-rg350-7a21e236035876c8ae581d4f9d61584c6385b89a.zip
GLK: FROTZ: Implement PageUp/PageDn scrolling of desc area in Beyond Zork
Diffstat (limited to 'engines/glk/windows.cpp')
-rw-r--r--engines/glk/windows.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/engines/glk/windows.cpp b/engines/glk/windows.cpp
index 8562e347ee..946a373151 100644
--- a/engines/glk/windows.cpp
+++ b/engines/glk/windows.cpp
@@ -342,6 +342,10 @@ void Windows::inputScrollFocus() {
void Windows::inputHandleKey(uint key) {
if (_moreFocus) {
inputMoreFocus();
+ } else if (_focusWin && (_focusWin->_lineRequest || _focusWin->_lineRequestUni) &&
+ _focusWin->checkTerminators(key)) {
+ // WORKAROUND: Do line terminators checking first. This was first needed for Beyond Zork,
+ // since it needs the Page Up/Down keys to scroll the description area rathern than the buffer area
} else {
switch (key) {
case keycode_Tab:
@@ -633,7 +637,7 @@ const WindowStyle *Window::getStyles() const {
void Window::setTerminatorsLineEvent(const uint32 *keycodes, uint count) {
if (dynamic_cast<TextBufferWindow *>(this) || dynamic_cast<TextGridWindow *>(this)) {
- delete _lineTerminatorsBase;
+ delete[] _lineTerminatorsBase;
_lineTerminatorsBase = nullptr;
if (!keycodes || count == 0) {
@@ -651,7 +655,7 @@ void Window::setTerminatorsLineEvent(const uint32 *keycodes, uint count) {
}
}
-bool Window::checkTerminator(uint32 ch) {
+bool Window::checkBasicTerminators(uint32 ch) {
if (ch == keycode_Escape)
return true;
else if (ch >= keycode_Func12 && ch <= keycode_Func1)
@@ -660,6 +664,18 @@ bool Window::checkTerminator(uint32 ch) {
return false;
}
+bool Window::checkTerminators(uint32 ch) {
+ if (checkBasicTerminators(ch))
+ return true;
+
+ for (uint idx = 0; idx < _termCt; ++idx) {
+ if (_lineTerminatorsBase[idx] == ch)
+ return true;
+ }
+
+ return false;
+}
+
bool Window::imageDraw(uint image, uint align, int val1, int val2) {
if (!g_conf->_graphics)
return false;