summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacobPalecki <[email protected]>2020-09-29 13:17:50 -0700
committerGitHub <[email protected]>2020-09-29 13:17:50 -0700
commit46e310b9168e2a662ca934bb2c924eea91d88d7f (patch)
treeb64eb67b725cab86edd5d8464216c50361ebebe8
parentMerge pull request #27 from JacobPalecki/GUI (diff)
parentPotential link fix, better power pic (diff)
downloadrawaccel-46e310b9168e2a662ca934bb2c924eea91d88d7f.tar.xz
rawaccel-46e310b9168e2a662ca934bb2c924eea91d88d7f.zip
Merge pull request #28 from a1xd/initial-release
interaccel converter
-rw-r--r--.gitignore2
-rw-r--r--Alpha.zipbin2072225 -> 0 bytes
-rw-r--r--README.md13
-rw-r--r--ReadMe.md22
-rw-r--r--common/accel-base.hpp2
-rw-r--r--converter/converter.cpp222
-rw-r--r--converter/converter.vcxproj109
-rw-r--r--converter/converter.vcxproj.filters22
-rw-r--r--doc/FAQ.md (renamed from grapher/ReadMe/FAQ.md)3
-rw-r--r--doc/Guide.md (renamed from grapher/ReadMe/Guide.md)22
-rw-r--r--doc/images/accel_readme_example.png (renamed from grapher/ReadMe/images/accel_readme_example.png)bin50019 -> 50019 bytes
-rw-r--r--doc/images/classic_example.png (renamed from grapher/ReadMe/images/classic_example.png)bin52040 -> 52040 bytes
-rw-r--r--doc/images/interaccel_to_rawaccel.png (renamed from grapher/ReadMe/images/interaccel_to_rawaccel.png)bin218717 -> 218717 bytes
-rw-r--r--doc/images/linear_example.png (renamed from grapher/ReadMe/images/linear_example.png)bin51428 -> 51428 bytes
-rw-r--r--doc/images/logarithm_example.png (renamed from grapher/ReadMe/images/logarithm_example.png)bin50553 -> 50553 bytes
-rw-r--r--doc/images/motivity_example.png (renamed from grapher/ReadMe/images/motivity_example.png)bin60657 -> 60657 bytes
-rw-r--r--doc/images/natural_example.png (renamed from grapher/ReadMe/images/natural_example.png)bin67409 -> 67409 bytes
-rw-r--r--doc/images/natural_gain_example.png (renamed from grapher/ReadMe/images/natural_gain_example.png)bin51433 -> 51433 bytes
-rw-r--r--doc/images/power_example.pngbin0 -> 51330 bytes
-rw-r--r--grapher/Form1.Designer.cs2
-rw-r--r--grapher/Models/AccelGUI.cs2
-rw-r--r--grapher/Models/Options/AccelOptionSet.cs8
-rw-r--r--grapher/Models/Options/AccelTypeOptions.cs25
-rw-r--r--grapher/Models/Options/ApplyOptions.cs6
-rw-r--r--grapher/ReadMe/ReadMe.md21
-rw-r--r--grapher/ReadMe/images/power_example.pngbin51672 -> 0 bytes
-rw-r--r--grapher/grapher.csproj40
-rw-r--r--grapher/mouse.icobin0 -> 112630 bytes
-rw-r--r--installer/installer.vcxproj3
-rw-r--r--rawaccel.sln20
-rw-r--r--uninstaller/uninstaller.vcxproj3
-rw-r--r--wrapper-deps/Class1.cs12
-rw-r--r--wrapper-deps/Properties/AssemblyInfo.cs36
-rw-r--r--wrapper-deps/packages.config4
-rw-r--r--wrapper-deps/wrapper-deps.csproj57
-rw-r--r--wrapper/wrapper.cpp20
-rw-r--r--wrapper/wrapper.vcxproj8
-rw-r--r--writer/packages.config4
-rw-r--r--writer/writer.csproj10
39 files changed, 617 insertions, 81 deletions
diff --git a/.gitignore b/.gitignore
index 4ce6fdd..35e04b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,8 @@ bld/
[Bb]in/
[Oo]bj/
[Ll]og/
+signed/*
+!signed/driver/
# Visual Studio 2015/2017 cache/options directory
.vs/
diff --git a/Alpha.zip b/Alpha.zip
deleted file mode 100644
index af777f0..0000000
--- a/Alpha.zip
+++ /dev/null
Binary files differ
diff --git a/README.md b/README.md
deleted file mode 100644
index c7bf054..0000000
--- a/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-## rawaccel
-rawaccel is a mouse acceleration driver for Windows 10 (64-bit)
-
-### build
-[Install the WDK for Windows 10](https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk)
-
-### install
-From an elevated prompt run `bcdedit /set testsigning on`, then run *installer.exe* and reboot.
-
-### usage
-*rawaccel.exe* is a console program that will apply your accel settings, for usage and options see `rawaccel help`.
-
-[precompiled test-signed binary available here](https://github.com/a1xd/rawaccel/releases)
diff --git a/ReadMe.md b/ReadMe.md
new file mode 100644
index 0000000..e7c073f
--- /dev/null
+++ b/ReadMe.md
@@ -0,0 +1,22 @@
+# Raw Accel
+
+Raw Accel is a Windows 10 64-bit driver which allows for the acceleration of mouse input in the raw input stream. It started as a replacement for [InterAccel](https://github.com/KovaaK/InterAccel) and has been extended with more acceleration types, charts, and other features.
+
+## Anti-Cheat Friendly
+
+[Releases](https://github.com/a1xd/rawaccel/releases/latest) of the Raw Accel driver are signed and run in system space. Raw Accel only modifies mouse input by a constant set of formulas, and adds a one-second delay when changing settings in order to mitigate its abuse.
+
+## Getting Help
+
+For an overview of everything Raw Accel has to offer, please see the [guide](doc/Guide.md). For questions, see the [FAQ](doc/FAQ.md) first.
+
+## Development
+
+Development of Raw Accel is ongoing at https://github.com/a1xd/rawaccel, bug reports and pull requests are always welcome. Join [our Discord server](https://discord.gg/7pQh8zH) if you want to stay updated with releases or say hello.
+
+## Credits
+simon - Driver & Acceleration Logic
+\_m00se\_ - GUI, Gain features, Acceleration types
+Sidiouth - Primary tester and sounding board
+TauntyArmordillo - Originator of the alternate curve ideas (Natural and Motivity types)
+Kovaak - Brought us together
diff --git a/common/accel-base.hpp b/common/accel-base.hpp
index 5106268..67a1b8f 100644
--- a/common/accel-base.hpp
+++ b/common/accel-base.hpp
@@ -48,7 +48,7 @@ namespace rawaccel {
struct nonadditive_accel : accel_val_base<Func> {
nonadditive_accel(const accel_args& args) : accel_val_base(args) {
- if (args.weight != 0) weight = args.weight;
+ if (args.weight > 0) weight = args.weight;
}
inline double operator()(double speed) const {
diff --git a/converter/converter.cpp b/converter/converter.cpp
new file mode 100644
index 0000000..3aff02c
--- /dev/null
+++ b/converter/converter.cpp
@@ -0,0 +1,222 @@
+#include <array>
+#include <charconv>
+#include <filesystem>
+#include <fstream>
+#include <iostream>
+#include <optional>
+#include <string>
+
+#include <rawaccel-settings.h>
+
+using namespace System;
+using namespace System::Runtime::InteropServices;
+using namespace Newtonsoft::Json;
+
+namespace ra = rawaccel;
+namespace fs = std::filesystem;
+
+const wchar_t* IA_SETTINGS_NAME = L"settings.txt";
+const wchar_t* IA_PROFILE_EXT = L".profile";
+
+enum IA_MODES_ENUM { IA_QL, IA_NAT, IA_LOG };
+
+constexpr std::array<std::string_view, 3> IA_MODES = {
+ "QuakeLive", "Natural", "Logarithmic"
+};
+
+// trim from start (in place)
+static inline void ltrim(std::string& s) {
+ s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) {
+ return !std::isspace(ch);
+ }));
+}
+
+// trim from end (in place)
+static inline void rtrim(std::string& s) {
+ s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) {
+ return !std::isspace(ch);
+ }).base(), s.end());
+}
+
+// trim from both ends (in place)
+static inline void trim(std::string& s) {
+ ltrim(s);
+ rtrim(s);
+}
+
+bool yes() {
+ bool b;
+ while (wchar_t c = _getwch()) {
+ if (c == 'y') {
+ b = true;
+ break;
+ }
+ else if (c == 'n') {
+ b = false;
+ break;
+ }
+ }
+ return b;
+}
+
+bool try_convert(const fs::path& fp) {
+ std::vector<std::pair<std::string, double>> kv_pairs;
+
+ {
+ std::ifstream ifs(fp);
+ std::string line;
+
+ while (std::getline(ifs, line)) {
+ if (line.empty()) continue;
+
+ auto delim_pos = line.find('=');
+ if (delim_pos == std::string::npos) continue;
+
+ std::string key(line.substr(0, delim_pos));
+ trim(key);
+
+ auto val_pos = line.find_first_not_of(" \t", delim_pos + 1);
+ if (val_pos == std::string::npos) continue;
+
+ double val = 0;
+
+ auto [p, ec] = std::from_chars(&line[val_pos], &line[0] + line.size(), val);
+
+ if (ec == std::errc()) {
+ kv_pairs.emplace_back(key, val);
+ }
+ else if (key == "AccelMode") {
+ std::string mode_val = line.substr(val_pos);
+ rtrim(mode_val);
+ auto it = std::find(IA_MODES.begin(), IA_MODES.end(), mode_val);
+ if (it != IA_MODES.end()) {
+ val = static_cast<double>(std::distance(IA_MODES.begin(), it));
+ kv_pairs.emplace_back(key, val);
+ }
+ }
+ }
+ }
+
+ auto get = [&](auto... keys) -> std::optional<double> {
+ auto it = std::find_if(kv_pairs.begin(), kv_pairs.end(), [=](auto&& p) {
+ return ((p.first == keys) || ...);
+ });
+ if (it == kv_pairs.end()) return std::nullopt;
+ return it->second;
+ };
+
+ ra::settings ra_settings;
+ ra::accel_args& args = ra_settings.argsv.x;
+
+ auto opt_mode = get("AccelMode");
+ if (!opt_mode) opt_mode = 0.0;
+
+ double accel = std::max(get("Acceleration").value_or(0), 0.0);
+ double sens = get("Sensitivity").value_or(1);
+ double cap = get("SensitivityCap").value_or(0);
+
+ std::cout << "We recommend trying out our new cap and offset styles.\n"
+ "Use new cap and offset? (y|n)\n";
+
+ args.legacy_offset = !yes();
+ args.offset = get("Offset").value_or(0);
+ args.accel = accel / sens * get("Pre-ScaleX").value_or(1);
+ args.limit = 1 + std::abs(cap - sens);
+
+ ra_settings.degrees_rotation = get("Angle", "AngleAdjustment").value_or(0);
+ ra_settings.sens = {
+ get("Post-ScaleX").value_or(1),
+ get("Post-ScaleY").value_or(1)
+ };
+
+ switch (static_cast<IA_MODES_ENUM>(opt_mode.value())) {
+ case IA_QL: {
+ auto opt_pow = get("Power");
+ if (!opt_pow || opt_pow.value() <= 1) return false;
+ args.exponent = opt_pow.value();
+
+ if (args.legacy_offset || cap <= 1) {
+ args.scale_cap = cap;
+ }
+ else {
+ double b = (cap - 1) / args.exponent;
+ double e = 1 / (args.exponent - 1);
+ args.gain_cap = args.offset + (1 / accel) * std::pow(b, e);
+ }
+ ra_settings.modes.x = ra::accel_mode::classic;
+ break;
+ }
+ case IA_NAT: {
+ std::cout << "Raw Accel offers a new mode that you might like more than Natural.\n"
+ "Wanna try it out now? (y|n)\n";
+ ra_settings.modes.x = yes() ? ra::accel_mode::naturalgain : ra::accel_mode::natural;
+ break;
+ }
+ case IA_LOG: {
+ std::cout << "Logarithmic accel mode is not supported.\n";
+ return true;
+ }
+ default: return false;
+ }
+
+ DriverSettings^ new_settings = Marshal::PtrToStructure<DriverSettings^>((IntPtr)&ra_settings);
+ auto errors = DriverInterop::GetSettingsErrors(new_settings);
+
+ if (errors->Empty()) {
+ Console::Write("Sending to driver... ");
+ DriverInterop::Write(new_settings);
+ Console::WriteLine("done");
+
+ Console::Write("Generating settings.json... ");
+ auto json = JsonConvert::SerializeObject(new_settings, Formatting::Indented);
+ System::IO::File::WriteAllText("settings.json", json);
+ Console::WriteLine("done");
+ }
+ else {
+ Console::WriteLine("Bad settings:\n" + errors->x->ToArray()[0]);
+ }
+
+ return true;
+}
+
+int main()
+{
+ std::optional<fs::path> opt_path;
+
+ if (fs::exists(IA_SETTINGS_NAME)) {
+ opt_path = IA_SETTINGS_NAME;
+ }
+ else {
+ for (auto&& entry : fs::directory_iterator(".")) {
+ if (fs::is_regular_file(entry) &&
+ entry.path().extension() == IA_PROFILE_EXT) {
+ opt_path = entry;
+ break;
+ }
+ }
+ }
+
+ if (opt_path) {
+ std::cout << "Found " << opt_path->filename() <<
+ "\n\nConvert and send settings generated from " <<
+ opt_path->filename() << "? (y|n)\n";
+ if (!yes()) return 0;
+ try {
+ if (!try_convert(opt_path.value()))
+ std::cout << "Unable to convert settings.\n";
+ }
+ catch (DriverNotInstalledException^) {
+ std::cout << "\nDriver is not installed\n";
+ }
+ catch (const std::exception& e) {
+ std::cout << "Error: \n" << e.what() << '\n';
+ }
+ }
+ else {
+ std::cout << "Drop your InterAccel settings/profile into this directory.\n"
+ "Then run this program to generate the equivalent Raw Accel settings.\n";
+ }
+
+ std::cout << "Press any key to close this window . . .\n";
+ _getwch();
+}
diff --git a/converter/converter.vcxproj b/converter/converter.vcxproj
new file mode 100644
index 0000000..3cbe7bf
--- /dev/null
+++ b/converter/converter.vcxproj
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>16.0</VCProjectVersion>
+ <Keyword>Win32Proj</Keyword>
+ <ProjectGuid>{4c421992-9a27-4860-a40c-add76fbace55}</ProjectGuid>
+ <RootNamespace>converter</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <CLRSupport>true</CLRSupport>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <CLRSupport>true</CLRSupport>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ <Import Project="..\common\common.vcxitems" Label="Shared" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ConformanceMode>true</ConformanceMode>
+ <LanguageStandard>stdcpp17</LanguageStandard>
+ <AdditionalOptions>/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ConformanceMode>true</ConformanceMode>
+ <LanguageStandard>stdcpp17</LanguageStandard>
+ <AdditionalOptions>/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <PostBuildEvent>
+ <Command>copy /Y "$(TargetPath)" "$(SolutionDir)signed\$(TargetFileName)"</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="converter.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\wrapper\wrapper.vcxproj">
+ <Project>{28a3656f-a1de-405c-b547-191c32ec555f}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/converter/converter.vcxproj.filters b/converter/converter.vcxproj.filters
new file mode 100644
index 0000000..954dbfa
--- /dev/null
+++ b/converter/converter.vcxproj.filters
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="converter.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/grapher/ReadMe/FAQ.md b/doc/FAQ.md
index 30080e8..df66579 100644
--- a/grapher/ReadMe/FAQ.md
+++ b/doc/FAQ.md
@@ -8,6 +8,7 @@ See the Guide to understand all options and features in-depth.
- There are many new features and curve types available. See the guide for information on all of these.
## How do I convert InterAccel settings to Raw Accel?
+For a quick 'n dirty conversion, drop your InterAccel settings or profile into Raw Accel's directory and run `converter.exe`. For GUI differences see the image below:
![ConvertExample](\images\interaccel_to_rawaccel.png)
See the guide to understand more about the Gain Cap option and other new features!
@@ -21,7 +22,7 @@ Instructions for these are in the beginning of the guide.
No. Once settings are passed to the driver by the GUI, they stay in use until the computer is shut down.
## Does the GUI need to be run every time I start my PC?
-Yes. The driver itself does not store your settings. To enable them on PC start, run the GUI, or run "writer.exe settings.json".
+Yes. The driver itself does not store your settings. To enable them on PC start, run the GUI, or run `writer.exe settings.json`.
## I don't understand something, or have some other question.
Read the guide to see if it answers your question. If not, join our [Discord](https://discord.gg/7pQh8zH) and ask. \ No newline at end of file
diff --git a/grapher/ReadMe/Guide.md b/doc/Guide.md
index ee026de..5f18e02 100644
--- a/grapher/ReadMe/Guide.md
+++ b/doc/Guide.md
@@ -1,11 +1,11 @@
# Raw Accel Guide
## Installation
-Run "installer.exe" in the release directory to install the raw accel driver. Restart your computer for the installation to take effect.
+Run `installer.exe` in the release directory to install the Raw Accel driver. Restart your computer for the installation to take effect.
-Run "uninstaller.exe" in the release directory to uninstall the driver. Restart for the uninstallation to take effect.
+Run `uninstaller.exe` in the release directory to uninstall the driver. Restart for the uninstallation to take effect.
-Run "grapher.exe" when the driver is installed in order to run the Raw Accel GUI.
+Run `rawaccel.exe` when the driver is installed in order to run the Raw Accel GUI.
## Philosophy
The Raw Accel driver and GUI's workings and exposed parameters are based on our understanding of mouse acceleration. Our understanding includes the concepts of "gain", "whole vs by component", and "anisotropy." For clarity, we will outline this understanding here. Those uninterested can skip to Features below.
@@ -29,7 +29,7 @@ and I move my mouse to create an input of (30,40) at a poll rate of 1000 hz.
Then our input speed is sqrt(30^2 + 40^2) = 50 counts/ms. Our accelerated sensitivity is calculated to be (1 + 0.1 \* 50) * 0.5 = 1.5 \* 0.5 = 0.75. So our output velocity is 0.75 \* 50 = 37.5. If I run the previous calculations with input speed 49.9 I get output velocity 37.40005, so our gain is about (37.5-37.40005)/(50-49.9) = 0.9995. Here is a picture of the charts in Raw Accel showing the same thing:
-![SensVelocityGainExample](\images\accel_readme_example.png)
+![SensVelocityGainExample](images/accel_readme_example.png)
### Horizontal and Vertical
If you wish, horizontal and vertical components of a mouse movement can be treated completely separately in Raw Accel. In the above example, they are not treated separately; rather they are "combined" by using the magnitude if the input vector: *sqrt(30^2 + 40^2) = 50 counts/ms*. This is called "Whole" application because the whole speed of the input is used. Application styles include:
@@ -72,24 +72,24 @@ The examples of various types below show some typical settings, without a cap or
### Linear
This is simplest style used by most; it is simply a line rising at a given rate. This is a good choice for new users.
-![LinearExample](\images\linear_example.png)
+![LinearExample](images/linear_example.png)
### Classic
This is the style found in Quake 3, Quake Live, and countless inspired followers, including the InterAccel program. It mulplies the speed by a given rate and then raises the product to a given exponent. Any particular linear style curve can be replicated in classic style with an exponent of 2.
-![ClassicExample](\images\classic_example.png)
+![ClassicExample](images/classic_example.png)
### Power
This is the style found in CS:GO and Source Engine games (m_customaccel 3). The user can set a rate by which the speed is multplied, and then an exponent to which the product is raised, which is then the final multiplier (no adding to 1.). In the aforementioned games the default m_customaccel_exponent value of 1.05 would be a value of 0.05 in Raw Accel, leading to a concave slowly rising curve. CS:GO and Source Engine games apply acceleration in an fps-dependent manner, so Raw Accel can only simulate acceleration from these games at a given fps. To do so, set scale to 1000/(in-game fps).
-![PowerExample](\images\power_example.png)
+![PowerExample](images/power_example.png)
### Natural & NaturalGain
Natural is a style found in the game Diabotical. It features a concave curve which starts at 1 and approaches some maximum sensitivity. This style is unique and useful but causes an ugly dip in the gain graph. For this reason we have created the NaturalGain style, which recreates the Natural style shape in the gain graph without any dips. We recommend users use the NaturalGain style instead of the Natural style; on switch some small tweaks may be needed since for any particular settings the NaturalGain is slightly slower to ramp up than the Natural style. NaturalGain is another excellent choice for new users.
-![NaturalExample](\images\natural_example.png)
-![NaturalGainExample](\images\natural_gain_example.png)
+![NaturalExample](images/natural_example.png)
+![NaturalGainExample](images/natural_gain_example.png)
### Motivity
-This curve looks like an "S" with the top half bigger than the bottom. Mathematically it's a "Sigmoid function on a log-log plot". A user can set the "midpoint" of the S, the "acceleration" (i.e. slantedness) of the S, and the "motivity". "Motivity" sets min and max sensitivity, where the maximum is just "motivity", and the minimum is "1/motivity." (Sensitivity is 1 at the midpoint.) This curve is calculated and stored in a lookup table before applying acceleration, which makes the gain graph look a little funny. This is one author's favorite curve, and an excellent choice for power users and new users who don't mind playing with the settings a little.
-![MotivityExample](\images\motivity_example.png)
+This curve looks like an "S" with the top half bigger than the bottom. Mathematically it's a "Sigmoid function on a log-log plot". A user can set the "midpoint" of the S, the "acceleration" (i.e. slantedness) of the S, and the "motivity". "Motivity" sets min and max sensitivity, where the maximum is just "motivity", and the minimum is "1/motivity." (Gain is 1 at the midpoint.) This curve is calculated and stored in a lookup table before applying acceleration, which makes the gain graph look a little funny. This is one author's favorite curve, and an excellent choice for power users and new users who don't mind playing with the settings a little.
+![MotivityExample](images/motivity_example.png)
## Further Help
Further help and frequently asked questions can be found in the FAQ. \ No newline at end of file
diff --git a/grapher/ReadMe/images/accel_readme_example.png b/doc/images/accel_readme_example.png
index 1622011..1622011 100644
--- a/grapher/ReadMe/images/accel_readme_example.png
+++ b/doc/images/accel_readme_example.png
Binary files differ
diff --git a/grapher/ReadMe/images/classic_example.png b/doc/images/classic_example.png
index e626e86..e626e86 100644
--- a/grapher/ReadMe/images/classic_example.png
+++ b/doc/images/classic_example.png
Binary files differ
diff --git a/grapher/ReadMe/images/interaccel_to_rawaccel.png b/doc/images/interaccel_to_rawaccel.png
index 4f3560a..4f3560a 100644
--- a/grapher/ReadMe/images/interaccel_to_rawaccel.png
+++ b/doc/images/interaccel_to_rawaccel.png
Binary files differ
diff --git a/grapher/ReadMe/images/linear_example.png b/doc/images/linear_example.png
index 5530529..5530529 100644
--- a/grapher/ReadMe/images/linear_example.png
+++ b/doc/images/linear_example.png
Binary files differ
diff --git a/grapher/ReadMe/images/logarithm_example.png b/doc/images/logarithm_example.png
index 3153ae5..3153ae5 100644
--- a/grapher/ReadMe/images/logarithm_example.png
+++ b/doc/images/logarithm_example.png
Binary files differ
diff --git a/grapher/ReadMe/images/motivity_example.png b/doc/images/motivity_example.png
index 521bf85..521bf85 100644
--- a/grapher/ReadMe/images/motivity_example.png
+++ b/doc/images/motivity_example.png
Binary files differ
diff --git a/grapher/ReadMe/images/natural_example.png b/doc/images/natural_example.png
index 9c7946b..9c7946b 100644
--- a/grapher/ReadMe/images/natural_example.png
+++ b/doc/images/natural_example.png
Binary files differ
diff --git a/grapher/ReadMe/images/natural_gain_example.png b/doc/images/natural_gain_example.png
index 48a05e4..48a05e4 100644
--- a/grapher/ReadMe/images/natural_gain_example.png
+++ b/doc/images/natural_gain_example.png
Binary files differ
diff --git a/doc/images/power_example.png b/doc/images/power_example.png
new file mode 100644
index 0000000..c8a58c9
--- /dev/null
+++ b/doc/images/power_example.png
Binary files differ
diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs
index 2ecdd95..2e68dcf 100644
--- a/grapher/Form1.Designer.cs
+++ b/grapher/Form1.Designer.cs
@@ -1271,7 +1271,7 @@ namespace grapher
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "RawAcceleration";
- this.Text = "Raw Acceleration Graph";
+ this.Text = "Raw Accel";
this.Load += new System.EventHandler(this.Form1_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.RawAcceleration_Paint);
((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).EndInit();
diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs
index 15a0c0e..11685ee 100644
--- a/grapher/Models/AccelGUI.cs
+++ b/grapher/Models/AccelGUI.cs
@@ -84,7 +84,7 @@ namespace grapher
},
combineMagnitudes = ApplyOptions.IsWhole,
modes = ApplyOptions.GetModes(),
- args = ApplyOptions.GetUpdatedArgs(ref driverSettings.args),
+ args = ApplyOptions.GetArgs(),
minimumTime = driverSettings.minimumTime
};
diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs
index 53c39af..11a7f10 100644
--- a/grapher/Models/Options/AccelOptionSet.cs
+++ b/grapher/Models/Options/AccelOptionSet.cs
@@ -98,14 +98,14 @@ namespace grapher.Models.Options
Options.Top = TopAnchor;
}
- public void SetArgs(ref AccelArgs args, ref /*readonly*/ AccelArgs last)
+ public void SetArgs(ref AccelArgs args)
{
- Options.SetArgs(ref args, ref last);
+ Options.SetArgs(ref args);
}
- public AccelArgs GenerateArgs(ref /*readonly*/ AccelArgs last)
+ public AccelArgs GenerateArgs()
{
- return Options.GenerateArgs(ref last);
+ return Options.GenerateArgs();
}
public void SetActiveValues(int mode, AccelArgs args)
diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs
index 9a4ab7c..f9ecac1 100644
--- a/grapher/Models/Options/AccelTypeOptions.cs
+++ b/grapher/Models/Options/AccelTypeOptions.cs
@@ -225,24 +225,25 @@ namespace grapher
Width = Acceleration.Field.Width;
}
- public void SetArgs(ref AccelArgs args, ref /*readonly*/ AccelArgs last)
+ public void SetArgs(ref AccelArgs args)
{
- args.acceleration = Acceleration.Visible ? Acceleration.Field.Data : last.acceleration;
- args.scale = Scale.Visible ? Scale.Field.Data : last.scale;
- args.gainCap = Cap.VelocityGainCap;
- args.scaleCap = Cap.SensitivityCap;
- args.limit = Limit.Visible ? Limit.Field.Data : last.limit;
- args.exponent = Exponent.Visible ? Exponent.Field.Data : last.exponent;
- args.offset = Offset.Offset;
+ AccelArgs defaults = (AccelArgs)DriverInterop.DefaultArgs;
+ args.acceleration = Acceleration.Visible ? Acceleration.Field.Data : defaults.acceleration;
+ args.scale = Scale.Visible ? Scale.Field.Data : defaults.scale;
+ args.gainCap = Cap.Visible ? Cap.VelocityGainCap : defaults.gainCap;
+ args.scaleCap = Cap.Visible ? Cap.SensitivityCap : defaults.scaleCap;
+ args.limit = Limit.Visible ? Limit.Field.Data : defaults.limit;
+ args.exponent = Exponent.Visible ? Exponent.Field.Data : defaults.exponent;
+ args.offset = Offset.Visible ? Offset.Offset : defaults.offset;
args.legacyOffset = Offset.IsLegacy;
- args.midpoint = Midpoint.Visible ? Midpoint.Field.Data : last.midpoint;
- args.weight = Weight.Visible ? Weight.Field.Data : last.weight;
+ args.midpoint = Midpoint.Visible ? Midpoint.Field.Data : defaults.midpoint;
+ args.weight = Weight.Visible ? Weight.Field.Data : defaults.weight;
}
- public AccelArgs GenerateArgs(ref /*readonly*/ AccelArgs last)
+ public AccelArgs GenerateArgs()
{
AccelArgs args = new AccelArgs();
- SetArgs(ref args, ref last);
+ SetArgs(ref args);
return args;
}
diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs
index 51c80ea..c2ed498 100644
--- a/grapher/Models/Options/ApplyOptions.cs
+++ b/grapher/Models/Options/ApplyOptions.cs
@@ -89,14 +89,14 @@ namespace grapher.Models.Options
};
}
- public Vec2<AccelArgs> GetUpdatedArgs(ref /*readonly*/ Vec2<AccelArgs> last)
+ public Vec2<AccelArgs> GetArgs()
{
- var xArgs = OptionSetX.GenerateArgs(ref last.x);
+ var xArgs = OptionSetX.GenerateArgs();
return new Vec2<AccelArgs>
{
x = xArgs,
- y = ByComponentVectorXYLock.Checked ? xArgs : OptionSetY.GenerateArgs(ref last.y)
+ y = ByComponentVectorXYLock.Checked ? xArgs : OptionSetY.GenerateArgs()
};
}
diff --git a/grapher/ReadMe/ReadMe.md b/grapher/ReadMe/ReadMe.md
deleted file mode 100644
index 84afc2a..0000000
--- a/grapher/ReadMe/ReadMe.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Raw Accel
-
-Raw Accel is a Windows 10 64-bit kernel driver which allows for the acceleration, or other modification, of mouse input in the raw input stream. It started as a replacement for the InterAccel program and Intercept driver, and has been extended with more acceleration types, charts, and other features.
-
-## Anti-Cheat Friendly
-
-Raw Accel will be signed to run as a fully trusted driver. It modifies mouse input only by a constant set of formulas and parameters, and has a one-second delay on writing settings to the driver, so it cannot be used to cheat.
-
-## Development
-
-Development of Raw Accel is ongoing at https://github.com/a1xd/rawaccel. Being a signed driver, the guts of the Raw Accel driver will be updated infrequently. The GUI can be updated as often was we like, however, so please let us know if you find any bugs.
-
-## Further Help
-For an overview of everything Raw Accel has to offer, please see the guide (guide.md). For a list of frequently asked questions, please see the FAQ (FAQ.md).
-
-## Credits
-simon - Driver & Acceleration Logic
-\_m00se\_ - GUI, Gain features, Acceleration types
-Sidiouth - Primary tester and sounding board
-TauntyAmordillo - Originator of the alternate curve ideas (Natural and Motivity types)
-Kovaak - Brought us together \ No newline at end of file
diff --git a/grapher/ReadMe/images/power_example.png b/grapher/ReadMe/images/power_example.png
deleted file mode 100644
index e17daaa..0000000
--- a/grapher/ReadMe/images/power_example.png
+++ /dev/null
Binary files differ
diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj
index 9e9b15b..a3e63ad 100644
--- a/grapher/grapher.csproj
+++ b/grapher/grapher.csproj
@@ -7,11 +7,26 @@
<ProjectGuid>{EF67F71F-ABF5-4760-B50D-D1B9836DF01C}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>grapher</RootNamespace>
- <AssemblyName>grapher</AssemblyName>
+ <AssemblyName>rawaccel</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@@ -35,6 +50,9 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
+ <PropertyGroup>
+ <ApplicationIcon>mouse.ico</ApplicationIcon>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
@@ -140,5 +158,25 @@
<Folder Include="Icon\" />
<Folder Include="ReadMe\" />
</ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="mouse.ico" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>IF ($(ConfigurationName)) == (Debug) GOTO END
+copy /Y "$(TargetPath)" "$(SolutionDir)signed\$(TargetFileName)"
+:END</PostBuildEvent>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/grapher/mouse.ico b/grapher/mouse.ico
new file mode 100644
index 0000000..493036a
--- /dev/null
+++ b/grapher/mouse.ico
Binary files differ
diff --git a/installer/installer.vcxproj b/installer/installer.vcxproj
index a91ed09..8ff13a6 100644
--- a/installer/installer.vcxproj
+++ b/installer/installer.vcxproj
@@ -95,6 +95,9 @@
<Manifest>
<AdditionalManifestFiles>install.manifest</AdditionalManifestFiles>
</Manifest>
+ <PostBuildEvent>
+ <Command>copy /Y "$(TargetPath)" "$(SolutionDir)signed\$(TargetFileName)"</Command>
+ </PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="installer.cpp" />
diff --git a/rawaccel.sln b/rawaccel.sln
index cfbbc23..aa226c1 100644
--- a/rawaccel.sln
+++ b/rawaccel.sln
@@ -14,16 +14,27 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uninstaller", "uninstaller\uninstaller.vcxproj", "{A4097FF6-A6F0-44E8-B8D0-538D0FB75936}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wrapper", "wrapper\wrapper.vcxproj", "{28A3656F-A1DE-405C-B547-191C32EC555F}"
+ ProjectSection(ProjectDependencies) = postProject
+ {0695A19E-8B14-4DE7-AADF-97E5912B197C} = {0695A19E-8B14-4DE7-AADF-97E5912B197C}
+ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "grapher", "grapher\grapher.csproj", "{EF67F71F-ABF5-4760-B50D-D1B9836DF01C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "writer", "writer\writer.csproj", "{28ACF254-E4EF-4A0E-9761-0FE22048D6FD}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wrapper-deps", "wrapper-deps\wrapper-deps.csproj", "{0695A19E-8B14-4DE7-AADF-97E5912B197C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "converter", "converter\converter.vcxproj", "{4C421992-9A27-4860-A40C-ADD76FBACE55}"
+ ProjectSection(ProjectDependencies) = postProject
+ {28A3656F-A1DE-405C-B547-191C32EC555F} = {28A3656F-A1DE-405C-B547-191C32EC555F}
+ EndProjectSection
+EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
common-install\common-install.vcxitems*{058d66c6-d88b-4fdb-b0e4-0a6fe7483b95}*SharedItemsImports = 9
common\common.vcxitems*{24b4226f-1461-408f-a1a4-1371c97153ea}*SharedItemsImports = 9
common\common.vcxitems*{28a3656f-a1de-405c-b547-191c32ec555f}*SharedItemsImports = 4
+ common\common.vcxitems*{4c421992-9a27-4860-a40c-add76fbace55}*SharedItemsImports = 4
common\common.vcxitems*{60d6c942-ac20-4c05-a2be-54b5c966534d}*SharedItemsImports = 4
common-install\common-install.vcxitems*{896950d1-520a-420a-b6b1-73014b92a68c}*SharedItemsImports = 4
common-install\common-install.vcxitems*{a4097ff6-a6f0-44e8-b8d0-538d0fb75936}*SharedItemsImports = 4
@@ -35,7 +46,6 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{60D6C942-AC20-4C05-A2BE-54B5C966534D}.Debug|x64.ActiveCfg = Debug|x64
{60D6C942-AC20-4C05-A2BE-54B5C966534D}.Debug|x64.Build.0 = Debug|x64
- {60D6C942-AC20-4C05-A2BE-54B5C966534D}.Debug|x64.Deploy.0 = Debug|x64
{60D6C942-AC20-4C05-A2BE-54B5C966534D}.Release|x64.ActiveCfg = Release|x64
{60D6C942-AC20-4C05-A2BE-54B5C966534D}.Release|x64.Build.0 = Release|x64
{896950D1-520A-420A-B6B1-73014B92A68C}.Debug|x64.ActiveCfg = Debug|x64
@@ -58,6 +68,14 @@ Global
{28ACF254-E4EF-4A0E-9761-0FE22048D6FD}.Debug|x64.Build.0 = Debug|x64
{28ACF254-E4EF-4A0E-9761-0FE22048D6FD}.Release|x64.ActiveCfg = Release|x64
{28ACF254-E4EF-4A0E-9761-0FE22048D6FD}.Release|x64.Build.0 = Release|x64
+ {0695A19E-8B14-4DE7-AADF-97E5912B197C}.Debug|x64.ActiveCfg = Debug|x64
+ {0695A19E-8B14-4DE7-AADF-97E5912B197C}.Debug|x64.Build.0 = Debug|x64
+ {0695A19E-8B14-4DE7-AADF-97E5912B197C}.Release|x64.ActiveCfg = Release|x64
+ {0695A19E-8B14-4DE7-AADF-97E5912B197C}.Release|x64.Build.0 = Release|x64
+ {4C421992-9A27-4860-A40C-ADD76FBACE55}.Debug|x64.ActiveCfg = Debug|x64
+ {4C421992-9A27-4860-A40C-ADD76FBACE55}.Debug|x64.Build.0 = Debug|x64
+ {4C421992-9A27-4860-A40C-ADD76FBACE55}.Release|x64.ActiveCfg = Release|x64
+ {4C421992-9A27-4860-A40C-ADD76FBACE55}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/uninstaller/uninstaller.vcxproj b/uninstaller/uninstaller.vcxproj
index 95a9dc8..f7e9f75 100644
--- a/uninstaller/uninstaller.vcxproj
+++ b/uninstaller/uninstaller.vcxproj
@@ -81,6 +81,9 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
</Link>
+ <PostBuildEvent>
+ <Command>copy /Y "$(TargetPath)" "$(SolutionDir)signed\$(TargetFileName)"</Command>
+ </PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="uninstaller.cpp" />
diff --git a/wrapper-deps/Class1.cs b/wrapper-deps/Class1.cs
new file mode 100644
index 0000000..397bd8f
--- /dev/null
+++ b/wrapper-deps/Class1.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wrapper_deps
+{
+ public class Class1
+ {
+ }
+}
diff --git a/wrapper-deps/Properties/AssemblyInfo.cs b/wrapper-deps/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..4e2bc26
--- /dev/null
+++ b/wrapper-deps/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("wrapper-deps")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("wrapper-deps")]
+[assembly: AssemblyCopyright("Copyright © 2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("0695a19e-8b14-4de7-aadf-97e5912b197c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/wrapper-deps/packages.config b/wrapper-deps/packages.config
new file mode 100644
index 0000000..a9de8b5
--- /dev/null
+++ b/wrapper-deps/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
+</packages> \ No newline at end of file
diff --git a/wrapper-deps/wrapper-deps.csproj b/wrapper-deps/wrapper-deps.csproj
new file mode 100644
index 0000000..35391b5
--- /dev/null
+++ b/wrapper-deps/wrapper-deps.csproj
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{0695A19E-8B14-4DE7-AADF-97E5912B197C}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>wrapper_deps</RootNamespace>
+ <AssemblyName>wrapper-deps</AssemblyName>
+ <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <Deterministic>true</Deterministic>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x64\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <LangVersion>7.3</LangVersion>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+ <OutputPath>bin\x64\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <LangVersion>7.3</LangVersion>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Class1.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project> \ No newline at end of file
diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp
index 72ebdc7..c665bed 100644
--- a/wrapper/wrapper.cpp
+++ b/wrapper/wrapper.cpp
@@ -30,6 +30,7 @@ public value struct AccelArgs
double exponent;
double midpoint;
double weight;
+ [JsonProperty("legacyCap")]
double scaleCap;
double gainCap;
};
@@ -82,13 +83,12 @@ void as_native(DriverSettings^ managed_args, NativeSettingsFunc fn)
if (Marshal::SizeOf(managed_args) != sizeof(settings))
throw gcnew InvalidOperationException("setting sizes differ");
#endif
- IntPtr unmanagedHandle = Marshal::AllocHGlobal(sizeof(settings));
- Marshal::StructureToPtr(managed_args, unmanagedHandle, false);
- fn(*reinterpret_cast<settings*>(unmanagedHandle.ToPointer()));
+ settings args;
+ Marshal::StructureToPtr(managed_args, (IntPtr)&args, false);
+ fn(args);
if constexpr (!std::is_invocable_v<NativeSettingsFunc, const settings&>) {
- Marshal::PtrToStructure(unmanagedHandle, managed_args);
+ Marshal::PtrToStructure((IntPtr)&args, managed_args);
}
- Marshal::FreeHGlobal(unmanagedHandle);
}
DriverSettings^ get_default()
@@ -137,9 +137,12 @@ error_list_t^ get_accel_errors(AccelMode mode, AccelArgs^ args)
if (args->acceleration > 1 && is_mode(am::natural, am::naturalgain))
error_list->Add("acceleration can not be greater than 1");
- else if (args->acceleration < 0)
- error_list->Add("acceleration can not be negative, use a negative weight to compensate");
-
+ else if (args->acceleration < 0) {
+ bool additive = m < am::power;
+ if (additive) error_list->Add("acceleration can not be negative, use a negative weight to compensate");
+ else error_list->Add("acceleration can not be negative");
+ }
+
if (args->scale <= 0)
error_list->Add("scale must be positive");
@@ -172,6 +175,7 @@ public:
public ref struct DriverInterop
{
literal double WriteDelayMs = WRITE_DELAY;
+ static initonly AccelArgs^ DefaultArgs = get_default()->args.x;
static DriverSettings^ GetActiveSettings()
{
diff --git a/wrapper/wrapper.vcxproj b/wrapper/wrapper.vcxproj
index 37060ad..6c85a57 100644
--- a/wrapper/wrapper.vcxproj
+++ b/wrapper/wrapper.vcxproj
@@ -66,6 +66,10 @@
<Link>
<AdditionalDependencies />
</Link>
+ <PostBuildEvent>
+ <Command>copy /Y "$(TargetPath)" "$(SolutionDir)signed\$(TargetFileName)" &amp;
+copy /Y "$(TargetDir)Newtonsoft.Json.dll" "$(SolutionDir)signed\Newtonsoft.Json.dll"</Command>
+ </PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="wrapper_io.hpp" />
@@ -75,7 +79,9 @@
<ClCompile Include="wrapper_io.cpp" />
</ItemGroup>
<ItemGroup>
- <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" />
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ </Reference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/writer/packages.config b/writer/packages.config
new file mode 100644
index 0000000..a9de8b5
--- /dev/null
+++ b/writer/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
+</packages> \ No newline at end of file
diff --git a/writer/writer.csproj b/writer/writer.csproj
index 4befc1a..a28d5ef 100644
--- a/writer/writer.csproj
+++ b/writer/writer.csproj
@@ -36,8 +36,8 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Newtonsoft.Json">
- <HintPath>..\x64\Release\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -54,6 +54,7 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
+ <None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\wrapper\wrapper.vcxproj">
@@ -62,4 +63,9 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>IF ($(ConfigurationName)) == (Debug) GOTO END
+copy /Y "$(TargetPath)" "$(SolutionDir)signed\$(TargetFileName)"
+:END</PostBuildEvent>
+ </PropertyGroup>
</Project> \ No newline at end of file