-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkbm_emulation.lua
More file actions
29 lines (23 loc) · 820 Bytes
/
kbm_emulation.lua
File metadata and controls
29 lines (23 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
local game_name = reframework:get_game_name()
local is_re7 = game_name == "re7"
local is_re8 = game_name == "re8"
if not is_re7 and not is_re8 then
return
end
log.info("[kbm_emulation.lua] loaded")
local function postHIDManager()
local hid_manager = sdk.get_managed_singleton(sdk.game_namespace("HIDManager"))
if is_re7 then
if hid_manager:get_field("<inputMode>k__BackingField") == 0 then
hid_manager:set_field("<inputMode>k__BackingField", 1)
end
end
if is_re8 then
if hid_manager:get_field("<inputMode>k__BackingField"):get_field("V") == 0 then
hid_manager:get_field("<inputMode>k__BackingField"):set_field("V", 1)
end
end
end
if is_re7 or is_re8 then
sdk.hook(sdk.find_type_definition(sdk.game_namespace("HIDManager")):get_method("doUpdate"), nil, postHIDManager)
end