SKYRIM
Better Gamepad key support (an SKSE Plugin) by NeoH4x0r
Skyrim » Utilities
Added: 19/11/2015 - 03:29AM
Updated: 31/10/2016 - 10:53AM

138 Endorsements

1.7.3.7 Latest version

1,311 Unique D/Ls

2,090 Total D/Ls

20,446 Total Views

Uploaded by NeoH4x0r

Description

Last updated at 10:53, 31 Oct 2016 Uploaded at 3:29, 19 Nov 2015

NOTE: This will not work with Skyrim Special Edition

Mod: Better Gamepad key support (an SKSE Plugin)
Version: 1.7.3.7

SCRIPTING FUNCTIONS ================================================================================================

added in v1.7.3.5
; returns the left-stick position from right to left (a value between -32768 to 32767)
float Function GetLX() global native

; returns the left-stick position from up to down (a value between -32768 to 32767)
float Function GetLY() global native

; returns the right-stick position from right to left (a value between -32768 to 32767)
float Function GetRX() global native

; returns the right-stick position from up to down (a value between -32768 to 32767)
float Function GetRY() global native

; direction enumeration:
QUOTE
enum
{
kDiretion_none               = 0,
kDiretion_up     = 1,
kDiretion_upright    = 2,
kDiretion_right = 3,
kDiretion_downright = 4,
kDiretion_down = 5,
kDiretion_downleft          = 6,
kDiretion_left                  = 7,
kDiretion_upleft              = 8,
};
; returns the left stick's direction  (a value between 0 and 8)
int Function GetLSDirection() global native
; returns the left stick's direction (a value between 0 and 8)
int Function GetRSDirection() global native




They can be accessed like this: 

float lx = Controller.GetLX()

---- these can also be accessed from scaleform by calling 

float lx = _global.skse.plugins.neoh4x0r-gpad.GetLX()
-or maybe- _global.GetLX()

DESCRIPTION ========================================================================================================

Adds better support for Gamepad functions.
* 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

NOTE: the following feature is not available in the plugin version (there is nothing I can do from the plugin side)
It requires a hard-modifiction to skse and cannot be modified / altered / changed by an skse plugin.

There is a workaround available on the bugs page
(it requires disabling the gamepad temporarily while configuring SkyUI hotkeys)


* 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.

INSTALLATION ===========================================================================================================

Install the mod using NMM or any other mod manager that supports fomod installes.
-Or- Extract the SKSE/Plugins folder to skyrim/Data/SKSE/Plugins

UNINSTALLATION =========================================================================================================

Unintall the mod using NMM or any other mod manager that supports fomod installes.
-Or- Delete the neoh4x0r-gpad.dll/.pdb from skyrim/Data/SKSE/Plugins

ISSUES =================================================================================================================

* SkyUI hotkeys cannot be assigned using keyboard/mouse buttons when a gamepad is active (even though the key bindings would work)
 ** for a workaround you can disable the gamepad when setting up hotkeys that use keyboard/mouse buttons (you can re-enable the gamepad afterwards)

INCOMPATIBILITY =========================================================================================================

This mod can intercept vanilla calls to Input functions and return the proper key codes for keyboard/mouse/gamepad keys, but
it cannot work if the author has hard-coded the control codes and does not use the input functions to check them.

Example:
-- int iHotKey = 156 ; (num enter) [this key is not mapped by skyrim]
-- RegisterForKey(iHotKey);
-- Event OnKeyDown(Int KeyCode)
--   If KeyCode == iHotKey
--     ; do something
--   EndIf
-- EndEvent

-- In this example: Better Gamepad Key Support would no be able to translate the key as thier is no gamepad equivalent.
-- however if wanted to use the TAB key (TweenMenu) we could the following
-- int iHotKey = 156 ;
--  iHotKey = GetMappedKey("Tween Menu");
-- This will either be 15 (TAB) if no gampead is used and 277 (BTN_B) if a gamepad is used.

-- This plugin autotranslates calls to IsKeyPressed, etc by checking to make sure that  keycode that is passed in is correct
-- given the context -- if 15 was passed into IsKeyPressed and a gamepad was used it translate that to 277.
-- but nothing can be done about keys that have no mapping in skyim

See the bugs page for more specific information and/or workarounds.

Alternate Donwload locations/Source =========================================================================================

* The main download page: http://www.netsolutions.dynu.com/DownloadID/1049
* If you want the latest bleeding-egde vesrgion:
http://www.netsolutions.dynu.com:81/websvn/tesv_skyrim/utilities/skse/tags/neoh4x0r-gpad/
* if you want to view the source in flat-directory:
http://www.netsolutions.dynu.com:81/websvn/tesv_skyrim/utilities/skse/branches/gamepad-work-plugin/
* if you want to view the source including svn log messages/get diffs/etc:
http://www.netsolutions.dynu.com:81/viewvc/skse/branches/gamepad-work-plugin/

Change Log =============================================================================================================

v 1.7.3.7  - 
    + add support for sending multiple keyup/down events in same call
    + fix issue with keycodes above 255 not working as intended when calling TapKey/HoldKey/ReleaseKey
    + add the following ini options
        send_major_movement_keys_only
        enable_verbose_debug
v 1.7.3.6  - add support to send movement keydown events when using the left joystick on the gamepad (also fix an issue with sending raw input to the game)
v 1.7.3.5  - fixed an issue with controller scripts functions not being thread-safe (also added scaleform versions of them)
v 1.7.3.4  -
   + cleaned up code
   + addeded ability to read left/right stick controller position as well as direction  
v 1.7.3.3  -  Implemented all remaining input functions (all keys can, now, be correctly detected using Input.IsKeyPressed) and added config support
v 1.7.3.2  -  Improved general support and code cleanup ... fully support TapKey/HoldKey/ReleaseKey to mods regirested for OnKeyUp/OnKeyDown events
v 1.7.3.1  -  Initial Release (requires SKSE 1.7.3)