Code Monkey home page Code Monkey logo

r1per / mousetovjoy Goto Github PK

View Code? Open in Web Editor NEW
24.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 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

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;
}

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.

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.

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

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,

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

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.

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.