mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-01 00:12:59 +00:00
TITANIC: Implement keyboard event handling
This commit is contained in:
parent
18fabbb2d4
commit
43f183c207
@ -187,6 +187,9 @@ void Events::keyDown(Common::KeyState keyState) {
|
||||
_vm->_debugger->attach();
|
||||
_vm->_debugger->onFrame();
|
||||
}
|
||||
|
||||
if (_vm->_window->_inputAllowed)
|
||||
_vm->_window->_gameManager->_inputTranslator.keyDown(keyState);
|
||||
}
|
||||
|
||||
void Events::keyUp(Common::KeyState keyState) {
|
||||
|
@ -94,4 +94,16 @@ void CInputTranslator::rightButtonDoubleClick(int special, const Point &pt) {
|
||||
_inputHandler->handleMessage(msg);
|
||||
}
|
||||
|
||||
void CInputTranslator::keyDown(const Common::KeyState &keyState) {
|
||||
if (keyState.keycode >= Common::KEYCODE_F1 && keyState.keycode <= Common::KEYCODE_F5) {
|
||||
CVirtualKeyCharMsg msg(keyState);
|
||||
_inputHandler->handleMessage(msg);
|
||||
}
|
||||
|
||||
if (keyState.ascii >= 32 && keyState.ascii <= 127) {
|
||||
CKeyCharMsg msg(keyState.ascii);
|
||||
_inputHandler->handleMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -23,6 +23,7 @@
|
||||
#ifndef TITANIC_INPUT_TRANSLATOR_H
|
||||
#define TITANIC_INPUT_TRANSLATOR_H
|
||||
|
||||
#include "common/keyboard.h"
|
||||
#include "titanic/messages/mouse_messages.h"
|
||||
|
||||
namespace Titanic {
|
||||
@ -50,6 +51,7 @@ public:
|
||||
void rightButtonDown(int special, const Point &pt);
|
||||
void rightButtonUp(int special, const Point &pt);
|
||||
void rightButtonDoubleClick(int special, const Point &pt);
|
||||
void keyDown(const Common::KeyState &keyState);
|
||||
};
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
Loading…
x
Reference in New Issue
Block a user