|
ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
|
输入映射配置 更多...
#include <Config.h>
Public 属性 | |
| std::unordered_map< std::string, ActionBinding > | actions |
| 动作绑定 | |
| std::unordered_map< std::string, AxisBinding > | axes |
| 轴绑定 | |
输入映射配置
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
| std::unordered_map<std::string, ActionBinding> actions |
动作绑定
| std::unordered_map<std::string, AxisBinding> axes |
轴绑定