File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -4217,7 +4217,28 @@ No overload found for function 'FPackageName:IsValidLongPackageName'.
42174217 erase_from_container (this , m_local_player_exec_post_callbacks);
42184218 erase_from_container (this , m_script_hook_callbacks);
42194219
4220- UE4SSProgram::get_program ().unregister_keydown_events_for_lua_mod (this );
4220+ UE4SSProgram::get_program ().get_all_input_events ([&](auto & key_set) {
4221+ std::erase_if (key_set.key_data ,
4222+ [&](auto & item) -> bool {
4223+ auto & [_, key_data] = item;
4224+ std::erase_if (key_data,
4225+ [&](Input::KeyData& key_data) -> bool {
4226+ // custom_data == 1: Bind came from Lua, and custom_data2 is a pointer to LuaMod.
4227+ // custom_data == 2: Bind came from C++, and custom_data2 is a pointer to KeyDownEventData. Must free it.
4228+ if (key_data.custom_data == 1 )
4229+ {
4230+ return key_data.custom_data2 == this ;
4231+ }
4232+ else
4233+ {
4234+ return false ;
4235+ }
4236+ });
4237+
4238+ return key_data.empty ();
4239+ });
4240+ });
4241+
42214242
42224243 if (m_hook_lua != nullptr )
42234244 {
You can’t perform that action at this time.
0 commit comments