fix F16-F24 keys offsetting keycodes, add key name to canvas key callback args
This commit is contained in:
parent
420f1d9731
commit
42acfb3f2d
@ -119,15 +119,6 @@ enum class Key : uint16_t {
|
|||||||
F13,
|
F13,
|
||||||
F14,
|
F14,
|
||||||
F15,
|
F15,
|
||||||
F16,
|
|
||||||
F17,
|
|
||||||
F18,
|
|
||||||
F19,
|
|
||||||
F20,
|
|
||||||
F21,
|
|
||||||
F22,
|
|
||||||
F23,
|
|
||||||
F24,
|
|
||||||
NumLock,
|
NumLock,
|
||||||
CapsLock,
|
CapsLock,
|
||||||
ScrollLock,
|
ScrollLock,
|
||||||
@ -146,7 +137,18 @@ enum class Key : uint16_t {
|
|||||||
SysReq,
|
SysReq,
|
||||||
Pause,
|
Pause,
|
||||||
Menu,
|
Menu,
|
||||||
Power
|
Power,
|
||||||
|
// can't have this where I want because canvases
|
||||||
|
// pass keycodes to Lua as a numeric code >:[
|
||||||
|
F16,
|
||||||
|
F17,
|
||||||
|
F18,
|
||||||
|
F19,
|
||||||
|
F20,
|
||||||
|
F21,
|
||||||
|
F22,
|
||||||
|
F23,
|
||||||
|
F24
|
||||||
};
|
};
|
||||||
extern EnumMap<Key> const KeyNames;
|
extern EnumMap<Key> const KeyNames;
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ void BaseScriptPane::tick(float dt) {
|
|||||||
}
|
}
|
||||||
for (auto p : m_canvasKeyCallbacks) {
|
for (auto p : m_canvasKeyCallbacks) {
|
||||||
for (auto const& keyEvent : p.first->pullKeyEvents())
|
for (auto const& keyEvent : p.first->pullKeyEvents())
|
||||||
m_script.invoke(p.second, (int)keyEvent.key, keyEvent.keyDown);
|
m_script.invoke(p.second, (int)keyEvent.key, keyEvent.keyDown, KeyNames.getRight(keyEvent.key));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_script.update(m_script.updateDt(dt));
|
m_script.update(m_script.updateDt(dt));
|
||||||
|
@ -28,8 +28,6 @@ StatusController::StatusController(Json const& config) : m_statCollection(config
|
|||||||
m_primaryScript.setScripts(jsonToStringList(config.get("primaryScriptSources", JsonArray())));
|
m_primaryScript.setScripts(jsonToStringList(config.get("primaryScriptSources", JsonArray())));
|
||||||
m_primaryScript.setUpdateDelta(config.getUInt("primaryScriptDelta", 1));
|
m_primaryScript.setUpdateDelta(config.getUInt("primaryScriptDelta", 1));
|
||||||
|
|
||||||
m_primaryScript.setUpdateDelta(config.getUInt("primaryScriptDelta", 1));
|
|
||||||
|
|
||||||
uint64_t keepDamageSteps = config.getUInt("keepDamageNotificationSteps", 120);
|
uint64_t keepDamageSteps = config.getUInt("keepDamageNotificationSteps", 120);
|
||||||
m_recentHitsGiven.setHistoryLimit(keepDamageSteps);
|
m_recentHitsGiven.setHistoryLimit(keepDamageSteps);
|
||||||
m_recentDamageGiven.setHistoryLimit(keepDamageSteps);
|
m_recentDamageGiven.setHistoryLimit(keepDamageSteps);
|
||||||
|
Loading…
Reference in New Issue
Block a user