Coder Social home page Coder Social logo

r1per / mousetovjoy Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 11.0 230.92 MB

Simple application that converts mouse/keyboard input to vjoy output, created using vjoyinterface and winapi32. Useful for games like Assetto Corsa, Live For Speed, Rfactor. Requires installed version of VJoy 2.1.8. As for version 1.7, Forcefeedback works with Constant Effect and Periodic Effect. Tested on Live for Speed and Rfactor and Assetto Corsa.

Home Page: https://r1per.itch.io/mtvj

License: MIT License

C++ 85.92% C 14.08%
vjoy mouse keyboard interpreter assetto-corsa freepie driving steering wheel

mousetovjoy's Introduction

20.03.2020 New version of program avaliable on https://r1per.itch.io/mtvj

MouseToVJoy

Application that converts mouse/keyboard input to vjoy output.

Simple application that converts mouse/keyboard input to vjoy output, created using vjoyinferace and winapi32.

Download

Releases tap on Github or https://github.com/R1PeR/MouseToVJoy/releases You need all three files

Installation

Windows:

Open MouseToVJoy.exe

Enjoy.

Usage example

Useful for racing games, created especially for Assetto Corsa to remove traction control that was build into gamee. Some games I tested it with: Assetto Corsa, Live For Speed, Rfactor.

Release History

  • 1.7
    • ADD: Support for 'ForceFeedback' on Assetto Corsa.
    • ADD: Use Wheel as Shifter.
  • 1.68
    • FIX: ForceFeedback not working.
  • 1.67
    • FIX: Issue with center reduction not working.
  • 1.66
    • FIX: Issue with self moving steering wheel.
  • 1.65
    • FIX: ForceFeedback not working.
  • 1.64
    • ADD: Command line support, '-noconsole' to launch without console.
    • FIX: Code structure, made it more pleasant to read.
  • 1.63
    • ADD: Force Feedback Working for Periodic Force.
  • 1.62
    • ADD: Ability to use mouse buttons on other functions than breake and throttle.
  • 1.61
    • FIX: UseMouse Not Working (Thanks nonical)
  • 1.6
    • ADD: Force Feedback Working only for Constant Force
  • 1.5
    • ADD: 3 Configurable buttons.
  • 1.41
    • FIX: Sensitivity Center Reduction not working.
  • 1.4
    • ADD: Sensitivity Center Reduction.
  • 1.3
    • ADD: Center Mouse Steering Axis.
  • 1.21
    • FIX: Typo in Breaking logic.
  • 1.2
    • ADD: Acceleration options.
  • 1.1
    • ADD: Configurable buttons.
  • 1.0
    • First working release.

Prerequisites

Requires installed version of VJoy 2.1.8. Available here: https://sourceforge.net/projects/vjoystick/files/Beta%202.x/

Configuration

Program can be configured through config.txt file, which have 21 different values, that can be modified through any text editor. For easier tweaking use VjoyMonitor to visualize axis changes.

Sensitivity

The main sensitivity multiplier. Raw data from mouse is multiplied by this value and then added to Vjoy Axis.

E.g. Sensitivity = 6.0

AttackTimeThrottle

Throttle value when pressed. When throttle is pressed, every 2 ms value is added to Vjoy Axis. The greater the steaper slope of attack.

E.g. AttackTimeThrottle = 200

ReleaseTimeThrottle

Throttle value when released. When throttle is released, every 2 ms value is subtracted from Vjoy Axis. The greater the steaper slope of release.

E.g. ReleaseTimeThrottle = 100

AttackTimeBreak

Break value when pressed. When break is pressed, every 2 ms value is added to Vjoy Axis. The greater the steaper slope of attack.

E.g. AttackTimeBreak = 200

ReleaseTimeBreak

Break value when released. When break is released, every 2 ms value is subtracted from Vjoy Axis. The greater the steaper slope of release.

E.g. ReleaseTimeBreak = 100

AttackTimeClutch

Clutch value when pressed. When clutch is pressed, every 2 ms value is added to Vjoy Axis. The greater the steaper slope of attack.

E.g. AttackTimeClutch = 200

ReleaseTimeClutch

Clutch value when released. When clutch is released, every 2 ms value is subtracted from Vjoy Axis. The greater the steaper slope of release.

E.g. ReleaseTimeClutch = 200

ThrottleKey

Key responsible for throttle control. Works only when UseMouse is equal to 0. Key value can be anything from 0 to 165 in ASCII KEYCODES!

E.g. ThrottleKey = 87 for "W"

BreakKey

Key responsible for break control. Works only when UseMouse is equal to 0. Key value can be anything from 0 to 165 in ASCII KEYCODES!

E.g. BreakKey = 69 for "E"

ClutchKey

Key responsible for clutch control. Key value can be anything from 0 to 165 in ASCII KEYCODES!

E.g. ClutchKey = 67 for "C"

GearShiftUpKey

Key responsible for gear shift up. Key value can be anything from 0 to 165 in ASCII KEYCODES!

E.g. GearShiftUpKey = 83 for "D"

GearShiftDownKey

Key responsible for gear shift down. Key value can be anything from 0 to 165 in ASCII KEYCODES!

E.g. GearShiftDownKey = 68 for "S"

HandBrakeKey

Key responsible for handbreak. Key value can be anything from 0 to 165 in ASCII KEYCODES!

E.g. HandBrakeKey = 32 for Space

MouseLockKey

Key responsible for locking mouse in 0,0 coordinates on monitor. Key value can be anything from 0 to 165 in ASCII KEYCODES!

E.g. MouseLockKey = 80 for "P"

MouseCenterKey

Key responsible for centering Steering Vjoy Axis. Key value can be anything from 0 to 165 in ASCII KEYCODES!

E.g. MouseCenterKey = 79 for "0"

UseMouse

Whenever to use mouse buttons as throttle and break. 0 for Disable, 1 for Enable.

E.g. UseMouse = 1

UseCenterReduction

Whenever to reduce mouse sensitivity when closer to center of axis. 0 for Disable, 1 for Enable.

E.g. UseCenterReduction = 1

UseForceFeedback

Whenever to use forcefeedback. 0 for Disable, 1 for Enable.

E.g. UseForceFeedback = 1

UseWheelAsShifter

Whenever to use mouse wheel as a sequential shifter. Mouse wheel up for next gear and mouse wheel down for lower gear. 0 for Disable, 1 for Enable.

E.g. UseWheelAsShifter = 1

AccelerationThrottle

Whenever to add linear acceleration on throttle Vjoy Axis. 0 for Disable, greater then 0 for Enable.

E.g. AccelerationThrottle = 1.01

AccelerationBreak

Whenever to add linear acceleration on break Vjoy Axis. 0 for Disable, greater then 0 for Enable.

E.g. AccelerationBreak = 1.01

AccelerationClutch

Whenever to add linear acceleration on clutch Vjoy Axis. 0 for Disable, greater then 0 for Enable.

E.g. AccelerationBreak = 1.01

CenterMultiplier

How much center reduction to use. Greater then 1 to make center less sensitive while making ends more sensitive. Lesser then 1 to make center more sensitive while making ends less sensitive.

E.g. CenterMultiplier = 1.20

Meta

Sebastian Waluś – [email protected]

https://github.com/R1per/github-link

Contributing

  1. Fork it (https://github.com/R1PeR/MouseToVJoy/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Built With

Acknowledgments

  • Hat tip to anyone who's code was used

mousetovjoy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mousetovjoy's Issues

Mouse axis and Handbreake detection

I'm using the recompiled version x64. Almost buttons works only Handbreake does not detect, same with Mouse axis in Assetto Corsa, rFactor but LFS works fine.

project cars 3 slow steering

Hello, did you try play project cars 3? I run this program, set steering wheel as controller in settings, And still steering is too slow like with keyboard,

Gearshift Up and Down option

Hi, i love your program, actually is much better than any mouse scripts from GlovePie or FreePIE but is very boring because i can't configure the Gearshift. Would be so cool if you could add this options on "config.txt":

GearshiftUpKey
GearshiftDownKey

Error missing dll files only in version 1.5

When i open the MouseToVJoy from 1.5 i got 3 errors of missing dll:

"A code execution can not continue because MSVCP140D.dll was not found. Reinstalling the program to correct the problem."
768le9avsustgdolemltvg

"A code execution can not continue because VCRUNTIME140D.dll was not found. Reinstalling the program to correct the problem."
nli6rjfith6tzjerjmtzua

"A code execution can not continue because ucrtbased.dll was not found. Reinstalling the program to correct the problem."
igsorze2tsuyg3kckwguqa

So after put them on SysWOW64 for try to fix this i got a other error:
slabeckzscqj5l10tykvuq
"The application could not be initialized correctly (0xc000007b)."

As you can see in the screenshot below, version 1.4 works correctly:
uxvhflpkrmoppc2t_tuvmg

How to use camera controls?

There's a lot of options in the "secondary" tab including camera controls, how do I change them? There's a separate keyboard column but that doesn't seem to work in game.

Steering ignores mouse acceleration(enhanced pointer precision)

I recently tried using your program for asseto corsa and it worked perfectly, but the problem is it ignores mouse acceleration/enhanced pointer precision. This makes it impossible for me to drive properly since when I originally learnt mouse steering on LFS ~3 years ago I did so with mouse acceleration active.

I'm not sure if there is anything you can do about this (a way to toggle raw input on/off, or if you can't do that with vjoy maybe you could add your own mouse acceleration setting?), but if you can I'd greatly appreciate it.

Segmentation fault on FileRead class

The function "newFile" in the FileRead class is accessing a position outside of the "checkArray" length, which may result in accessing a protected memory region (Segmentation fault).

The issue is the maximum value of 'i' is 32 but the checkArray in that case is 23:

// Segmentation fault
for(int i = 0; i < 32; i++){
    if (tmp == checkArray[i]) {
        _resultArray[i] = value;
    }
}

I think a simple fix can be like this:

// fileread.h
// { ... }    Others includes
#include<vector>

class FileRead {
public:
    BOOL newFile(std::string fileName, std::string checkArray[], size_t checkArraySize);

    double result(int number) { 
        if (_resultArray && number < _resultLen)
            return _resultArray[number];
        else
        {
            // Some error handling
        }
    };
private:
    size_t _resultLen = 0;
    double* _resultArray = NULL;
};

Each time you call the 'newFile' function, it will free the old memory if it exists and allocates a new one to store the results.

// fileread.cpp
BOOL FileRead::newFile(std::string fileName, std::string checkArray[], size_t checkArraySize) {
    if (this->_resultArray)
        free(_resultArray); // Free de old allocated memory
    this->_resultLen = Lenght;
    if(!(_resultArray = static_cast<double*>(malloc(sizeof(double) * Lenght)))) // Allocate a new memory ( can be done with 'new(double[size])' )
        return FALSE;
    ZeroMemory(_resultArray, Lenght * sizeof(double));
    std::ifstream file(fileName);
    if (!file.is_open()) 
    {
        printf("Config file not found\n");
        return FALSE;
    }
    // { ... }    Code
    for(int i = 0; i < checkArraySize; i++){
        if (tmp == checkArray[i]) {
            _resultArray[i] = value;
        }
    }
    // { ... }   Code
    file.close();
    return TRUE;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.