Introduce a better fix for the Mac OS X backspace problem by adding the workaround to default-events.cpp.

svn-id: r43441
This commit is contained in:
Matthew Hoops 2009-08-16 14:04:54 +00:00
parent a718e608f4
commit ce30a513ac
3 changed files with 6 additions and 11 deletions

View file

@ -162,6 +162,12 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
} }
} }
#endif #endif
else if (event.kbd.keycode == Common::KEYCODE_BACKSPACE) {
// WORKAROUND: On Mac OS X, the ascii value for backspace
// has to be set to the backspace keycode in order to work
// properly.
event.kbd.ascii = Common::KEYCODE_BACKSPACE;
}
break; break;
case Common::EVENT_KEYUP: case Common::EVENT_KEYUP:

View file

@ -499,10 +499,6 @@ void AGOSEngine::delay(uint amount) {
} }
_keyPressed = event.kbd; _keyPressed = event.kbd;
// Make sure backspace works right (this fixes a small issue on OS X)
if (_keyPressed.keycode == Common::KEYCODE_BACKSPACE)
_keyPressed.ascii = Common::KEYCODE_BACKSPACE;
break; break;
case Common::EVENT_MOUSEMOVE: case Common::EVENT_MOUSEMOVE:
break; break;

View file

@ -135,13 +135,6 @@ void ScummEngine::parseEvent(Common::Event event) {
// Normal key press, pass on to the game. // Normal key press, pass on to the game.
_keyPressed = event.kbd; _keyPressed = event.kbd;
} }
// WORKAROUND: On Mac OS X, the ascii value has to be set to the
// backspace keycode in order for the backspace to work in HE games.
// This includes using the backspace when entering coach names
// in the backyard games.
if (_keyPressed.keycode == Common::KEYCODE_BACKSPACE)
_keyPressed.ascii = Common::KEYCODE_BACKSPACE;
// FIXME: We are using ASCII values to index the _keyDownMap here, // FIXME: We are using ASCII values to index the _keyDownMap here,
// yet later one code which checks _keyDownMap will use KEYCODEs // yet later one code which checks _keyDownMap will use KEYCODEs