diff options
author | D G Turner | 2011-06-08 04:16:54 +0100 |
---|---|---|
committer | D G Turner | 2011-06-08 04:16:54 +0100 |
commit | b5bb4125690e6277e001d0a1356ff50b2e361578 (patch) | |
tree | 50a6018ecdb231c6c784645351e46204d24b844c /engines | |
parent | e3a409b9a42af315e8e9fb23c755bdc8357ddcf9 (diff) | |
download | scummvm-rg350-b5bb4125690e6277e001d0a1356ff50b2e361578.tar.gz scummvm-rg350-b5bb4125690e6277e001d0a1356ff50b2e361578.tar.bz2 scummvm-rg350-b5bb4125690e6277e001d0a1356ff50b2e361578.zip |
AGI: Numeric Keypad Control in Predictive Dialog (Bug #3309376)
In AGI games, the numeric keypad is used as an alias for cursor keys to
allow stationary and 8 directional input, but while the predictive
dialog is open, this is more sensibly mapped to numeric input to
allow use of the predictive input on desktop ports.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/agi.cpp | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 78316588b0..811a58f45d 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -131,46 +131,65 @@ void AgiEngine::processEvents() { switch (key = event.kbd.keycode) { case Common::KEYCODE_LEFT: case Common::KEYCODE_KP4: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP4) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_LEFT; break; case Common::KEYCODE_RIGHT: case Common::KEYCODE_KP6: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP6) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_RIGHT; break; case Common::KEYCODE_UP: case Common::KEYCODE_KP8: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP8) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_UP; break; case Common::KEYCODE_DOWN: case Common::KEYCODE_KP2: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP2) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_DOWN; break; case Common::KEYCODE_PAGEUP: case Common::KEYCODE_KP9: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP9) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_UP_RIGHT; break; case Common::KEYCODE_PAGEDOWN: case Common::KEYCODE_KP3: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP3) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_DOWN_RIGHT; break; case Common::KEYCODE_HOME: case Common::KEYCODE_KP7: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP7) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_UP_LEFT; break; case Common::KEYCODE_END: case Common::KEYCODE_KP1: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP1) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_DOWN_LEFT; break; case Common::KEYCODE_KP5: - key = KEY_STATIONARY; + if (_predictiveDialogRunning) + key = event.kbd.ascii; + else + key = KEY_STATIONARY; break; case Common::KEYCODE_PLUS: key = '+'; |