diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-26 11:25:45 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-26 11:25:45 -0400 |
commit | 585fc3873406049a37f9417afc061c9cde266b76 (patch) | |
tree | 5440e7ebbc6332242ab899d38eb9cb6ffbfa09c0 /AnodyneArchipelago | |
parent | 3df389e9beb6b73d0f1a68475a112fb9c3e65b72 (diff) | |
download | anodyne-archipelago-585fc3873406049a37f9417afc061c9cde266b76.tar.gz anodyne-archipelago-585fc3873406049a37f9417afc061c9cde266b76.tar.bz2 anodyne-archipelago-585fc3873406049a37f9417afc061c9cde266b76.zip |
Add clipboard pasting to text inputs
Diffstat (limited to 'AnodyneArchipelago')
-rw-r--r-- | AnodyneArchipelago/AnodyneArchipelago.csproj | 1 | ||||
-rw-r--r-- | AnodyneArchipelago/Menu/InputHandler.cs | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/AnodyneArchipelago/AnodyneArchipelago.csproj b/AnodyneArchipelago/AnodyneArchipelago.csproj index a750332..2edb613 100644 --- a/AnodyneArchipelago/AnodyneArchipelago.csproj +++ b/AnodyneArchipelago/AnodyneArchipelago.csproj | |||
@@ -47,5 +47,6 @@ | |||
47 | <Reference Include="System.ValueTuple"> | 47 | <Reference Include="System.ValueTuple"> |
48 | <HintPath>..\..\BepInEx\bin\NET.Framework\net462\System.ValueTuple.dll</HintPath> | 48 | <HintPath>..\..\BepInEx\bin\NET.Framework\net462\System.ValueTuple.dll</HintPath> |
49 | </Reference> | 49 | </Reference> |
50 | <Reference Include="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | ||
50 | </ItemGroup> | 51 | </ItemGroup> |
51 | </Project> | 52 | </Project> |
diff --git a/AnodyneArchipelago/Menu/InputHandler.cs b/AnodyneArchipelago/Menu/InputHandler.cs index 284d321..432b40c 100644 --- a/AnodyneArchipelago/Menu/InputHandler.cs +++ b/AnodyneArchipelago/Menu/InputHandler.cs | |||
@@ -1,6 +1,7 @@ | |||
1 | using AnodyneSharp.Input; | 1 | using AnodyneSharp.Input; |
2 | using Microsoft.Xna.Framework.Input; | 2 | using Microsoft.Xna.Framework.Input; |
3 | using System.Collections.Generic; | 3 | using System.Collections.Generic; |
4 | using System.Threading; | ||
4 | 5 | ||
5 | namespace AnodyneArchipelago.Menu | 6 | namespace AnodyneArchipelago.Menu |
6 | { | 7 | { |
@@ -86,6 +87,17 @@ namespace AnodyneArchipelago.Menu | |||
86 | 87 | ||
87 | public static string ReturnCharacter() | 88 | public static string ReturnCharacter() |
88 | { | 89 | { |
90 | if (KeyInput.JustPressedKey(Keys.V) && (KeyInput.IsKeyPressed(Keys.LeftControl) || KeyInput.IsKeyPressed(Keys.RightControl))) | ||
91 | { | ||
92 | string result = ""; | ||
93 | Thread clipboardThread = new(() => result = System.Windows.Forms.Clipboard.GetText()); | ||
94 | clipboardThread.SetApartmentState(ApartmentState.STA); | ||
95 | clipboardThread.Start(); | ||
96 | clipboardThread.Join(); | ||
97 | |||
98 | return result; | ||
99 | } | ||
100 | |||
89 | foreach (InputCharacter inputCharacter in _characters) | 101 | foreach (InputCharacter inputCharacter in _characters) |
90 | { | 102 | { |
91 | if (KeyInput.JustPressedKey(inputCharacter.ReturnKey())) | 103 | if (KeyInput.JustPressedKey(inputCharacter.ReturnKey())) |