[Scummvm-git-logs] scummvm master -> f0e5675ceb05007fea517d20c73af81716dc94af
sev-
noreply at scummvm.org
Mon Sep 1 14:55:13 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
f0e5675ceb PRIVATE: Add keymapper support
Commit: f0e5675ceb05007fea517d20c73af81716dc94af
https://github.com/scummvm/scummvm/commit/f0e5675ceb05007fea517d20c73af81716dc94af
Author: aunnoman1 (aunnoman123 at outlook.com)
Date: 2025-09-01T16:55:10+02:00
Commit Message:
PRIVATE: Add keymapper support
Changed paths:
engines/private/POTFILES
engines/private/metaengine.cpp
engines/private/private.cpp
engines/private/private.h
diff --git a/engines/private/POTFILES b/engines/private/POTFILES
index 5c3e57518ee..ce1cac7ac2f 100644
--- a/engines/private/POTFILES
+++ b/engines/private/POTFILES
@@ -1 +1,2 @@
engines/private/detection.cpp
+engines/private/metaengine.cpp
diff --git a/engines/private/metaengine.cpp b/engines/private/metaengine.cpp
index 42f861e6e5a..c009c00dff7 100644
--- a/engines/private/metaengine.cpp
+++ b/engines/private/metaengine.cpp
@@ -26,6 +26,10 @@
#include "private/private.h"
#include "private/detection.h"
+#include "backends/keymapper/action.h"
+#include "backends/keymapper/keymapper.h"
+#include "backends/keymapper/standard-actions.h"
+
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_SUBTITLES,
@@ -64,6 +68,7 @@ public:
Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
void getSavegameThumbnail(Graphics::Surface &thumb) override;
+ Common::KeymapArray initKeymaps(const char *target) const override;
};
Common::Error PrivateMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
@@ -79,6 +84,28 @@ void PrivateMetaEngine::getSavegameThumbnail(Graphics::Surface &thumb) {
delete vs;
}
+Common::KeymapArray PrivateMetaEngine::initKeymaps(const char *target) const {
+ using namespace Common;
+ using namespace Private;
+
+ Keymap *engineKeymap = new Keymap(Keymap::kKeymapTypeGame, "private-default", _("Default keymappings"));
+ Action *act;
+
+ act = new Action(kStandardActionLeftClick, _("Select / Interact"));
+ act->setLeftClickEvent();
+ act->addDefaultInputMapping("MOUSE_LEFT");
+ act->addDefaultInputMapping("JOY_A");
+ engineKeymap->addAction(act);
+
+ act = new Action("SKIP", _("Skip video"));
+ act->setCustomEngineActionEvent(kActionSkip);
+ act->addDefaultInputMapping("ESCAPE");
+ act->addDefaultInputMapping("JOY_X");
+ engineKeymap->addAction(act);
+
+ return Keymap::arrayOf(engineKeymap);
+}
+
namespace Private {
bool PrivateEngine::isDemo() const {
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index df61fda48c0..e2fd5460173 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -295,8 +295,8 @@ Common::Error PrivateEngine::run() {
mousePos = g_system->getEventManager()->getMousePos();
// Events
switch (event.type) {
- case Common::EVENT_KEYDOWN:
- if (event.kbd.keycode == Common::KEYCODE_ESCAPE && _videoDecoder) {
+ case Common::EVENT_CUSTOM_ENGINE_ACTION_START:
+ if (event.customType == kActionSkip && _videoDecoder) {
skipVideo();
}
break;
diff --git a/engines/private/private.h b/engines/private/private.h
index c5051ded855..35385b81395 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -45,6 +45,10 @@ struct ADGameDescription;
namespace Private {
+enum PRIVATEActions {
+ kActionSkip,
+};
+
// debug channels
enum {
kPrivateDebugFunction = 1,
More information about the Scummvm-git-logs
mailing list