case SDLK_LEFT: return ZC_ARROW_LEFT;\r
case SDLK_RIGHT: return ZC_ARROW_RIGHT;\r
case SDLK_TAB: return (allowed ? VK_TAB : 0);\r
+ case SDLK_PAGEUP: return (allowed ? VK_PAGE_UP : 0);\r
+ case SDLK_PAGEDOWN: return (allowed ? VK_PAGE_DOWN : 0);\r
case SDLK_KP0: return ZC_NUMPAD_MIN+0;\r
case SDLK_KP1: return ZC_NUMPAD_MIN+1;\r
case SDLK_KP2: return ZC_NUMPAD_MIN+2;\r
pos--;\r
sf_DrawInput(buf,pos,ptx,pty,width,true);\r
}\r
- break;\r
+ continue;\r
+ case ZC_ESCAPE: /* Delete whole line */\r
+ pos = 0;\r
+ buf[0] = '\0';\r
+ searchpos = -1;\r
+ gen_history_reset();\r
+ sf_DrawInput(buf,pos,ptx,pty,width,true);\r
+ continue;\r
case VK_TAB:\r
if (pos == (int)mywcslen(buf)) {\r
zchar extension[10], *s;\r
buf[pos] = 0;\r
sf_DrawInput(buf,pos,ptx,pty,width,true);\r
}\r
- break;\r
+ continue;\r
case ZC_ARROW_LEFT:\r
// Move the cursor left\r
if (pos > 0)\r
pos--;\r
sf_DrawInput(buf,pos,ptx,pty,width,true);\r
- break;\r
+ continue;\r
case ZC_ARROW_RIGHT:\r
// Move the cursor right\r
if (pos < (int)mywcslen(buf))\r
pos++;\r
sf_DrawInput(buf,pos,ptx,pty,width,true);\r
- break;\r
+ continue;\r
case ZC_ARROW_UP:\r
case ZC_ARROW_DOWN:\r
if (searchpos < 0)\r
pos = mywcslen(buf);\r
sf_DrawInput(buf,pos,ptx,pty,width,true);\r
}\r
- break;\r
+ continue;\r
+ /* Pass through as up/down arrows for Beyond Zork. */\r
+ case VK_PAGE_UP: c = ZC_ARROW_UP; break;\r
+ case VK_PAGE_DOWN: c = ZC_ARROW_DOWN; break;\r
default:\r
- if (is_terminator(c)) {\r
- // Terminate the current input\r
- m_exitPause = false;\r
- sf_DrawInput(buf,pos,ptx,pty,width,false);\r
-\r
- if ((c == ZC_SINGLE_CLICK) || (c == ZC_DOUBLE_CLICK)) {\r
- /* mouse_x = input.mousex+1;\r
- mouse_y = input.mousey+1;*/\r
- } else if (c == ZC_RETURN)\r
- gen_add_to_history(buf);\r
- // theWnd->SetLastInput(buf);\r
- return c;\r
- } else if (sf_IsValidChar(c) && mywcslen(buf) < max) {\r
+ if (sf_IsValidChar(c) && mywcslen(buf) < max) {\r
// Add a valid character to the input line\r
// Get the width of the new input line\r
int len = os_string_width(buf);\r
pos++;\r
sf_DrawInput(buf,pos,ptx,pty,width,true);\r
}\r
+ continue;\r
}\r
}\r
+ if (is_terminator(c)) {\r
+ // Terminate the current input\r
+ m_exitPause = false;\r
+ sf_DrawInput(buf,pos,ptx,pty,width,false);\r
+\r
+ if ((c == ZC_SINGLE_CLICK) || (c == ZC_DOUBLE_CLICK)) {\r
+ /* mouse_x = input.mousex+1;\r
+ mouse_y = input.mousey+1;*/\r
+ } else if (c == ZC_RETURN)\r
+ gen_add_to_history(buf);\r
+ // theWnd->SetLastInput(buf);\r
+ return c;\r
+ }\r
}\r
}\r
if ((timeout) && (sf_ticks() >= mytimeout)) {\r