ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
载入中...
搜索中...
未找到
InputMappingsConfig结构体 参考

输入映射配置 更多...

#include <Config.h>

Public 属性

std::unordered_map< std::string, ActionBindingactions
 动作绑定
std::unordered_map< std::string, AxisBindingaxes
 轴绑定

详细描述

输入映射配置

settings.json 中的 inputMappings 段: { "actions": { "Jump": ["Space"], "Attack": ["J", "E"], "Sprint": ["Left Shift"] }, "axes": { "Horizontal": { "negative": ["A"], "positive": ["D"] }, "Vertical": { "negative": ["S"], "positive": ["W"] } } }

键名使用 SDL 官方 scancode 名;也接受无空格别名(LeftShift → Left Shift)。 鼠标:MouseButton.Left / Right / Middle / XButton1 / XButton2

类成员变量说明

◆ actions

std::unordered_map<std::string, ActionBinding> actions

动作绑定

◆ axes

std::unordered_map<std::string, AxisBinding> axes

轴绑定


该结构体的文档由以下文件生成: