diff --git a/Base/Base.csproj b/Base/Base.csproj index a5462f2..5e5a783 100644 --- a/Base/Base.csproj +++ b/Base/Base.csproj @@ -53,12 +53,6 @@ - - - {23DE4AE0-5075-4CCC-8440-4D131CA0FBBA} - W32 - - diff --git a/Base/Input.cs b/Base/Input.cs index 710b72e..de0ad01 100644 --- a/Base/Input.cs +++ b/Base/Input.cs @@ -1,5 +1,4 @@ -using CC_Functions.W32; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; @@ -12,6 +11,8 @@ namespace Base { public static class Input { + [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)] + static extern short GetKeyState(int keyCode); /// /// Check whether the Key is pressed /// @@ -21,7 +22,13 @@ namespace Base { try { - return KeyboardReader.IsKeyDown(key); + int state = 0; + short retVal = GetKeyState((int)key); + if ((retVal & 0x8000) == 0x8000) + state |= 1; + if ((retVal & 1) == 1) + state |= 2; + return 1 == (state & 1); } catch (Exception e) { diff --git a/LaptopSimulator2015.sln b/LaptopSimulator2015.sln index 9ab9d76..bb683c3 100644 --- a/LaptopSimulator2015.sln +++ b/LaptopSimulator2015.sln @@ -60,8 +60,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LevelTest", "LevelTest\Leve {DFA2FB97-D676-4B0D-B281-2685F85781EE} = {DFA2FB97-D676-4B0D-B281-2685F85781EE} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "W32", "..\CC-Functions\W32\W32.csproj", "{23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -116,10 +114,6 @@ Global {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Debug|Any CPU.Build.0 = Debug|Any CPU {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Release|Any CPU.ActiveCfg = Release|Any CPU {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Release|Any CPU.Build.0 = Release|Any CPU - {23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/LaptopSimulator2015/LaptopSimulator2015.csproj b/LaptopSimulator2015/LaptopSimulator2015.csproj index 6786bf6..fd17afa 100644 --- a/LaptopSimulator2015/LaptopSimulator2015.csproj +++ b/LaptopSimulator2015/LaptopSimulator2015.csproj @@ -123,10 +123,6 @@ - - {23de4ae0-5075-4ccc-8440-4d131ca0fbba} - W32 - {9a9561a7-dd5f-43a5-a3f5-a95f35da204d} Base diff --git a/LaptopSimulator2015/Program.cs b/LaptopSimulator2015/Program.cs index c30b8f0..a84aae7 100644 --- a/LaptopSimulator2015/Program.cs +++ b/LaptopSimulator2015/Program.cs @@ -1,5 +1,4 @@ -using CC_Functions.W32; -using LaptopSimulator2015.Properties; +using LaptopSimulator2015.Properties; using System; using System.Drawing; using System.IO; @@ -25,7 +24,6 @@ namespace LaptopSimulator2015 Console.Title = "LaptopSimulator2015"; splash = new Splash(); splash.Show(); - Wnd32.fromForm(splash).MakeOverlay(); Thread.Sleep(2000); #if !DEBUG FileStream filestream = new FileStream(".log", FileMode.Create); diff --git a/ToDo.txt b/ToDo.txt index 30858c0..ec16c61 100644 --- a/ToDo.txt +++ b/ToDo.txt @@ -1,4 +1,4 @@ -Maybe Linux builds? (P/Invoke would need to be interchangable, needs to be researched) +Maybe Linux builds? (Possible with #if, need a function to check whether a key is down in Linux (see Base/Input)) Ideas for content: - Goals: