Neanka / MCM_0.1_AS3

35 stars 6 forks source link

MCM Hotkeys #17

Open JoerQc opened 6 years ago

JoerQc commented 6 years ago

Quick request for assistance. I am trying to get hotkeys working ingame, however the script is not receiving the sendevent from the MCM. I have other mods installed where hotkeys work without issue so I know my version of MCM and F4SE are good.

I have the keybind.json set up properly as well as the hotkey selection in the MCM itself - if I set a hotkey in the MCM, it remembers the key stroke and records it into the keybind file in the settings folder. However, in the papyrus script attached to the quest neither OnControlUp or OnControlDown will receive the event. I have validated the formID and the mod name are exact.

Keybinds.json contents:

{ "modName": "FP_RSE", "keybinds": [ { "id": "RSEHotKey", "desc": "RSE HotKey", "action": { "type": "SendEvent", "form": "FP_RSE.esp|83B1" } } ] }

MCM hotkey definition:

{
"id": "RSEHotKey",
"text": "RSE HotKey",
"type": "hotkey",
"help": "The hotkey that activates RSE's test function. <b>DOES NOT WORK YET!</b>"
}

Papyrus fragment (test to see if key press registered):

Event OnControlDown(String sKey) If (sKey == "RSEHotKey") Debug.Notification("Key Press Registered!") Endif EndEvent

The FormID the sendevent refers to only has one script attached to the refalias, if this makes a difference. Is there something I am missing that is not mentioned in the wiki? I have looked at the source for HoloTime as well and it seems I am aligning to what should be done, yet my mod still refuses to receive the key press, regardless of how I set the hotkey in the MCM.

For further clarity, the keybind file from Settings Folder:

{"id":"RSEHotKey","keycode":220,"modName":"FP_RSE","modifiers":0}],"version":1}

Any guidance would be wonderfully accepted!

JoerQc commented 6 years ago

22 Days, no help. :/

Figured out the problem after three weeks and solved it myself. Perhaps updating the documentation in regards to this will help others down the road.

The receiving script for Hot Keys MUST be attached at the QUEST level, not attached to a Reference Alias, as the ref alias does not have a formID and thus does not receive the OnControlUp or OnControlDown events that the MCM sends.