Closed southpawgeek closed 1 month ago
Fixed by https://github.com/SGG-Modding/Hell2Modding/commit/434394bdb8c7ca65a9c1d39516d0a43c6e1f20e1
If it still happen post a message here
Thanks for addressing this! Unbinding makes it stop calling the function which is good. But, it still shows up in the log so I think some remnant still exists somewhere. Here's how the log looks if I do the following:
ctrl P
ctrl P
ctrl O
ctrl O
ctrl P
You can see the previous ctrl P
bind still exists, but it doesn't actually call the function
[18:29:50.0381155][INFO/inputs.cpp:396] Jowday-DamageMeter Keybind Registered: Ctrl P - Toggle Meter Visibility
[18:29:52.2025747][DEBUG/inputs.cpp:341] Ctrl P (Jowday-DamageMeter)
[18:29:52.2025757][DEBUG/inputs.cpp:345] Toggle Meter Visibility
[18:29:57.7829137][INFO/inputs.cpp:396] Jowday-DamageMeter Keybind Registered: Ctrl O - Toggle Meter Visibility
[18:30:1.1194603][DEBUG/inputs.cpp:341] Ctrl P (Jowday-DamageMeter)
[18:30:1.1840768][DEBUG/inputs.cpp:341] Ctrl O (Jowday-DamageMeter)
[18:30:1.1840778][DEBUG/inputs.cpp:345] Toggle Meter Visibility
Also here is the implementation
function setBind()
if CurrentBind ~= nil then
rom.inputs.remove_on_key_pressed(CurrentBind)
end
CurrentBind = rom.inputs.on_key_pressed({
config.ToggleMeterBind,
Name = "Toggle Meter Visibility",
function()
config.ShowMeter = not config.ShowMeter
end
})
end
I couldn't find a way to unbind - is there/should there be a function for this, or should I force the mod to reload when updating a keybind?