QRCode
SKSE 1.6.6 (runtime 1.8.151) with Better Gamepad key support

SKSE 1.6.6 (runtime 1.8.151) with Better Gamepad key support:

>    This Modified version adds better support for gamepad key functions



To Download the latest version of the neoh4x0r-gpad plugin: Visit the download page


Updated Features (as of 2015/04/29):
  • Updated to skse: 1.7.2
  • All Gamepad Keys can be used with, and fully work with, the following input functions:
    IsKeyPressed | TapKey | HoldKey | ReleaseKey | GetMappedKey | IsKeyHeld | DisableKey | EnableKey | IsKeyDisabled | GetNthKeyPressed
  • Input.IsKeyPressed function can detect pressing with following keys with a gamepad:
    Forward/Back/Strafe Left/Strafe Right and trigger buttons
  • Added gamepad support for the following keys:
    Auto-Move | Quick Map | Quick Inventory | Quick Magic | Quick Stats | Screenshot | Mult-Screenshot (takes 10 screenshots evey 0.5s)
    NOTE: these keys must be used with a scripted hotkey mod (you can even set them up using an MCM menu, if you add MCM support)
  • Input.GetMappedKey: will automatically return the proper key code regardless of keyboard or gamepad usage
  • Input.GetMappedKey: now allows things like SkyUI to map keybaord keys and gamepad keys at the same time
    NOTE: you cannot use a keyboard and gamepad key for the same entry
    However, you can map entries to keyboard keys and map others to gamepad keys.
  • The whole point of these modifications was to make scripted mods work seamlessly with keyboards and xinput gamepads.
    Reports from some users are stating: 'that mods that did not work fully with a gamepad...are now...fully supported without being updated or messed with'

The problem with the original version of SKSE 1.6.6 was that if a gamepad was being used, then SKSE script functions such as: TapKey, HoldKey, ReleaseKey, etc would not work.
Because Skyrim does not listen to keyboard input for input events that are linked to a gamepad key...instead it listens to XInput for them and not DirectInput.
For the mentiiond SKSE Functions: TapKey, HoldKey, ReleaseKey, etc ( I temporarily disable the gamepad, call the function, then re-enable the gamepad if needed) -- this allows the game to process the keyboard input events using the original SKSE methods, as intended.

For Example: (Exit inventory menu, "Tween Menu" )
Keyboard key=TAB
GamePad = B (this is the XBOX 360 Button, NOT 'B' on the keyboard)
With the gamepad enabled...the game will not exit the inventory menu if the TAB key is pressed, because it is only listening to the 'B' button (via XInput) on the 360 controller.
Temporarily disabling the gamepad via SKSE (internally), allows the game to process the inventory exit event via the corresponding keyboard key (TAB). ** this assumes that the key has not been re-mapped to another (wich SKSE already has code to handle)

So, with the modifications made to the above version: (NeoH4x0r-GamepadFix) you should be able to download the zip file, extract it into the root of the Skyrim folder, call skse_loader.exe and beable to use the script methods that were referenced.

Creation Kit Scripting Reference: http://www.creationkit.com/Category:Papyrus
Creation Kit Scripting Event Reference: http://www.creationkit.com/Category:Events



Example Script usage: (scripted inventory menu exit via a spell [magic effect script])
NOTE: you can use the code under OnEffectStart with any script type, it does not have to be activemagiceffect

Scriptname YourMagicSpellScriptName extends activemagiceffect  
string MENUEXIT = "Tween Menu"
Event OnEffectStart(Actor akTarget, Actor akCaster)
    Game.DisablePlayerControls()	
    int dxkey = Input.GetMappedKey(MENUEXIT)
    ;Input.HoldKey(dxkey)
    While (Utility.IsInMenuMode())
        ; block until menu exit
        Input.TapKey(dxkey)
    EndWhile
    ;Input.ReleaseKey(dxkey)	
    ; perform your processing here
    Game.EnablePlayerControls()	
EndEvent

skyrim,skse,gamepad,xinput,papyrus