PEGASUS: Handle mouse wheel events using the keymapper

This commit is contained in:
Cameron Cawley 2021-04-16 23:24:44 +01:00 committed by Filippos Karapetis
parent 394288db98
commit 4e33d6ad2b
2 changed files with 4 additions and 12 deletions

View File

@ -63,18 +63,8 @@ void InputDeviceManager::getInput(Input &input, const InputBits filter) {
InputBits currentBits = 0;
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_WHEELUP:
currentBits |= (kRawButtonDown << kUpButtonShift);
break;
case Common::EVENT_WHEELDOWN:
currentBits |= (kRawButtonDown << kDownButtonShift);
break;
default:
break;
}
}
while (g_system->getEventManager()->pollEvent(event))
;
// Now fill in the rest of the bitfield
if (_keysDown[kPegasusActionUp])

View File

@ -2713,6 +2713,7 @@ Common::KeymapArray PegasusEngine::initKeymaps() {
act->addDefaultInputMapping("UP");
act->addDefaultInputMapping("KP8");
act->addDefaultInputMapping("JOY_UP");
act->addDefaultInputMapping("MOUSE_WHEEL_UP");
engineKeyMap->addAction(act);
act = new Action(kStandardActionMoveDown, _("Down/Zoom Out"));
@ -2720,6 +2721,7 @@ Common::KeymapArray PegasusEngine::initKeymaps() {
act->addDefaultInputMapping("DOWN");
act->addDefaultInputMapping("KP5");
act->addDefaultInputMapping("JOY_DOWN");
act->addDefaultInputMapping("MOUSE_WHEEL_DOWN");
engineKeyMap->addAction(act);
act = new Action(kStandardActionMoveLeft, _("Turn Left"));