Title: Mouse Keycode Offset Bug in DKAF (Observed with Cancel Attack) I’ve encountered and resolved an issue with the "Dynamic Key Action Framework (DKAF)" while using it with the "Cancel Attack" mod, and I’d like to share my findings. Since DKAF serves as a foundation for various mods beyond just Cancel Attack, this might be helpful to others experiencing similar problems with different mods. Issue Description In my case, I was configuring "Cancel Attack" via DKAF’s JSON file (CancelAttack.json) and noticed that mouse button keycodes were consistently shifted by +1 from the intended values:
Setting "Keys": "259" (Mouse Button 3) resulted in Mouse Button 4 (keycode 260) being recognized.
Setting "Keys": "261" (Mouse Button 5) led to no response, likely because my mouse only has two side buttons (260 and 261), and 262 (Mouse Button 6) doesn’t exist on my hardware.
Interestingly, keyboard keys like "Keys": "49" (N key) worked as expected without any offset. Environment
SKSE: SKSE64 2.0.20 (compatible with Skyrim SE 1.5.97)
Hardware: Mouse with two side buttons (mapped to keycodes 260 and 261)
Root Cause After extensive testing, I confirmed that the issue stems from DKAF’s handling of mouse button keycodes (259 and above). It appears that DKAF’s DLL (DKAF.dll) applies a +1 offset specifically to mouse inputs, while keyboard inputs remain unaffected. This isn’t a problem with "Cancel Attack" itself or my hardware but a bug in DKAF’s mouse keycode processing. Since DKAF is used as a framework for many mods, this could potentially affect other mods relying on it, though I personally observed it with Cancel Attack. Workaround To assign an action (in my case, Cancel Attack) to the desired mouse button, you can account for the offset:
For Mouse Button 4 (260), set "Keys": "259".
For Mouse Button 5 (261), set "Keys": "260".
This workaround worked perfectly for me, aligning the action with my intended buttons when using Cancel Attack. Additional Note The default "Cancel Attack" key (R, keycode 19) remains active even after configuring DKAF, as it’s hardcoded into the mod’s ESP and not overridden by DKAF. This is normal behavior per Cancel Attack’s design and unrelated to the keycode offset issue. Hope this helps anyone troubleshooting similar issues with DKAF-dependent mods!
This is a modder's resource, if you're just installing another mod that requires this plugin you don't need to do anything other than installing this.
If you want to know how to use this plugin you need to know coding, have programming skills, software and scripting knowledge, and know how to acces built-in modding tools for any of this to make sense.
Does anyone know if ActionActivate on Furniture can be implemented using DKAF? By that I mean, ActionActivate needs an Object Ref ID as a furniture target of anim type, so is it possible to have that as the action with Paired Keywords to reference the furniture?
Ok, so there seems to be little traffic here, so I'll just leave my issue here for when anyone sees it. I'm trying to initiate an action on locating an ActorNPC within close proximity to the PC. However, the Targeting algorithms for the Paired Keyword Search doesn't seem to be functioning well. Irrespective of the Search Mode 1, 2 or 3 the Actions play always on keypress, without any actor being in range or even in the same cell. My json is this: { "Bump": { "Keys": "29,17", "GamepadKeys": "", "PairedSearchMode": 3, "PairedSearchDist": 100, "PairedTargetKeywords": "Skyrim.esm|0x13795,Skyrim.esm|0x13794", "ActionOrIdle": "Skyrim.esm|0x3DE4D", "PressDuration": 0.2, "Priority": 100 } }
https://www.creationkit.com/index.php?title=Input_Script is down and it's been down for a long while now. does anyone else have the key code reference numbers? or at least for Right Mouse key Space bar and the Letter Q for me, thanks?
Those correspond to the EditorIDs of the available Action or Idle for the player character. These can be found using SSEdit on Skyrim.esm, though not all idles or actions work for players.
Does this mod allow me to use gamepad and keyboard like AutoInputSwitch? If not, could I use AutoInputSwitch with this mod installed? I'm using a modlist.
66 comments
I’ve encountered and resolved an issue with the "Dynamic Key Action Framework (DKAF)" while using it with the "Cancel Attack" mod, and I’d like to share my findings. Since DKAF serves as a foundation for various mods beyond just Cancel Attack, this might be helpful to others experiencing similar problems with different mods.
Issue Description
In my case, I was configuring "Cancel Attack" via DKAF’s JSON file (CancelAttack.json) and noticed that mouse button keycodes were consistently shifted by +1 from the intended values:
- Setting "Keys": "259" (Mouse Button 3) resulted in Mouse Button 4 (keycode 260) being recognized.
- Setting "Keys": "260" (Mouse Button 4) triggered Mouse Button 5 (keycode 261).
- Setting "Keys": "261" (Mouse Button 5) led to no response, likely because my mouse only has two side buttons (260 and 261), and 262 (Mouse Button 6) doesn’t exist on my hardware.
Interestingly, keyboard keys like "Keys": "49" (N key) worked as expected without any offset.Environment
- Game: Skyrim Special Edition 1.5.97
- Mods: Cancel Attack (v1.0.0.0, Nexus ID: 92353), DKAF (v1.0.0.0, Nexus ID: 87706)
- SKSE: SKSE64 2.0.20 (compatible with Skyrim SE 1.5.97)
- Hardware: Mouse with two side buttons (mapped to keycodes 260 and 261)
Root CauseAfter extensive testing, I confirmed that the issue stems from DKAF’s handling of mouse button keycodes (259 and above). It appears that DKAF’s DLL (DKAF.dll) applies a +1 offset specifically to mouse inputs, while keyboard inputs remain unaffected. This isn’t a problem with "Cancel Attack" itself or my hardware but a bug in DKAF’s mouse keycode processing. Since DKAF is used as a framework for many mods, this could potentially affect other mods relying on it, though I personally observed it with Cancel Attack.
Workaround
To assign an action (in my case, Cancel Attack) to the desired mouse button, you can account for the offset:
- For Mouse Button 4 (260), set "Keys": "259".
- For Mouse Button 5 (261), set "Keys": "260".
This workaround worked perfectly for me, aligning the action with my intended buttons when using Cancel Attack.Additional Note
The default "Cancel Attack" key (R, keycode 19) remains active even after configuring DKAF, as it’s hardcoded into the mod’s ESP and not overridden by DKAF. This is normal behavior per Cancel Attack’s design and unrelated to the keycode offset issue.
Hope this helps anyone troubleshooting similar issues with DKAF-dependent mods!
Can anyone provide some details about this?
If you want to know how to use this plugin you need to know coding, have programming skills, software and scripting knowledge, and know how to acces built-in modding tools for any of this to make sense.
I'm trying to initiate an action on locating an ActorNPC within close proximity to the PC. However, the Targeting algorithms for the Paired Keyword Search doesn't seem to be functioning well. Irrespective of the Search Mode 1, 2 or 3 the Actions play always on keypress, without any actor being in range or even in the same cell.
My json is this:
{
"Bump": {
"Keys": "29,17",
"GamepadKeys": "",
"PairedSearchMode": 3,
"PairedSearchDist": 100,
"PairedTargetKeywords": "Skyrim.esm|0x13795,Skyrim.esm|0x13794",
"ActionOrIdle": "Skyrim.esm|0x3DE4D",
"PressDuration": 0.2,
"Priority": 100
}
}
Any help would be appreciated, thanks!