Skip to content

Commit

Permalink
Add support for Xinput controllers. Add an option to remap the key fo…
Browse files Browse the repository at this point in the history
…r pause (both keyboard and controller). Update to v1.1.0.
  • Loading branch information
iArtorias committed Mar 18, 2022
1 parent 949cd52 commit 2e22c66
Show file tree
Hide file tree
Showing 9 changed files with 944 additions and 6 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
## Usage

1. Download the [latest release](https://github.com/iArtorias/elden_pause/releases/latest)
2. Copy the `version.dll` to your Elden Ring game folder
2. Copy the `version.dll` and `elden_pause.ini` to your Elden Ring game folder
3. Launch the game with EAC disabled
* To do this, create the file `steam_appid.txt` with the text `1245620` in your game folder and run `eldenring.exe` directly
4. Press `P` button to pause the game. Press the same button again to resume the game.
5. If you're using controller, press `Start` button

## Remapping the keys

1. Open `elden_pause.ini`
2. If you want to change the keyboard key code, edit the `KeyboardButton` option value
3. If you want to change the controller key code, edit the `ControllerButton` option value
* `Optional:` you can change the `ControllerEnabled` option value to `false` if you don't need to use the controller code

## Advantages

Expand All @@ -24,6 +32,7 @@
## Stuff used

- **Mem** (https://github.com/0x1F9F1/mem)
- **IniReader** (https://github.com/X-rays5/inireader)

## Credits

Expand Down
44 changes: 44 additions & 0 deletions elden_pause.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[Settings]
# A specific mapped keyboard code.
# For the full list, please visit: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
# "0x50" by default
KeyboardButton=0x50
# A specific mapped controller code.
# Here is the full list of available codes:
# A 0x5800
# B 0x5801
# X 0x5802
# Y 0x5803
# Right shoulder button 0x5804
# Left shoulder button 0x5805
# Left trigger 0x5806
# Right trigger 0x5807
# Directional pad up 0x5810
# Directional pad down 0x5811
# Directional pad left 0x5812
# Directional pad right 0x5813
# START button 0x5814
# BACK button 0x5815
# Left thumbstick click 0x5816
# Right thumbstick click 0x5817
# Left thumbstick up 0x5820
# Left thumbstick down 0x5821
# Left thumbstick right 0x5822
# Left thumbstick left 0x5823
# Left thumbstick up and left 0x5824
# Left thumbstick up and right 0x5825
# Left thumbstick down and right 0x5826
# Left thumbstick down and left 0x5827
# Right thumbstick up 0x5830
# Right thumbstick down 0x5831
# Right thumbstick right 0x5832
# Right thumbstick left 0x5833
# Right thumbstick up and left 0x5834
# Right thumbstick up and right 0x5835
# Right thumbstick down and right 0x5836
# Right thumbstick down and left 0x5837
# "0x5814" by default
ControllerButton=0x5814
# Disable or enable the usage of controller code.
# "true" by default
ControllerEnabled=true
9 changes: 7 additions & 2 deletions elden_pause/elden_pause.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;ELDENPAUSE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;ELDENPAUSE_EXPORTS;_WINDOWS;_USRDLL;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand All @@ -68,6 +68,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>xinput.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -76,7 +77,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;ELDENPAUSE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;ELDENPAUSE_EXPORTS;_WINDOWS;_USRDLL;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand All @@ -91,11 +92,14 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>xinput.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="framework.h" />
<ClInclude Include="include\button_state.h" />
<ClInclude Include="include\inireader\conversion.hpp" />
<ClInclude Include="include\inireader\inireader.hpp" />
<ClInclude Include="include\mem\aligned_alloc.h" />
<ClInclude Include="include\mem\arch.h" />
<ClInclude Include="include\mem\bitwise_enum.h" />
Expand All @@ -120,6 +124,7 @@
<ClInclude Include="include\mem\slice.h" />
<ClInclude Include="include\mem\stub.h" />
<ClInclude Include="include\mem\utils.h" />
<ClInclude Include="include\misc.h" />
<ClInclude Include="include\stub.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
Expand Down
12 changes: 12 additions & 0 deletions elden_pause/elden_pause.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<Filter Include="Header Files\deps\mem">
<UniqueIdentifier>{09e4bcf7-bcf0-4f17-80d4-58c2f69c0f5d}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\deps\inireader">
<UniqueIdentifier>{1ed93747-03ba-4496-96f4-fe7ac00234ab}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
Expand Down Expand Up @@ -105,6 +108,15 @@
<ClInclude Include="include\stub.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\misc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\inireader\conversion.hpp">
<Filter>Header Files\deps\inireader</Filter>
</ClInclude>
<ClInclude Include="include\inireader\inireader.hpp">
<Filter>Header Files\deps\inireader</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
Expand Down
2 changes: 2 additions & 0 deletions elden_pause/framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
#include <winternl.h>
#include <processthreadsapi.h>
#include <memoryapi.h>
#include <synchapi.h>
#include <WinUser.h>
#include <filesystem>
#include <Xinput.h>

// WinAPI stub
#include <stub.h>
Expand Down
Loading

0 comments on commit 2e22c66

Please sign in to comment.