Skip to content

zlociu/Xbox-Controller-Mouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xbox-Controller-Mouse mouse icon

About

Control Your computer with Xbox One gamepad.
Turn on application and plug in your Xbox controller, wired or wireless via Bluetooth.
Working only on Windows.

Decscription 📋

Features

  • mouse buttons & scroll functions
  • keyboard keys (single)
  • keyboard macros (up to 3 keys)
  • creating own profiles
  • battery status

Create own profile 💻

If You want to create new profile, changing some of gamepad rules please read this part.

  1. Create new class which inherit from Control class. In file OwnControl.h it should be:
#pragma once
#include "Control.h"

class OwnControl : public Control
{
public:
	OwnControl(Gamepad* gp) : Control(gp) {}

	void MouseControl();
};
  1. In OwnControl.cpp write MouseControl() implementation.
    1. Easiest way to implement MouseControl() function is to copy from DefaultControl.cpp.
    2. Replace given functions between START and END comment blocks.
    case XINPUT_GAMEPAD_A:
        {
            // START own function
            DefaultControl::SendLeftMouseHold(XINPUT_GAMEPAD_A);
            // END own function
        } break;
    ...
    1. In Control.h are defined available functions that you can use. You can also create new functions.
  2. In Source.cpp in Main() function replace with your own class. Add also header file of your own class. #include "ownControl.h"
Gamepad g1 = Gamepad();
Control* c1;

//replace with your class
DefaultControl dc1 = DefaultControl(&g1);
c1 = &dc1;
// END replace with your class
...
  1. Build and run new version of application.

Compile & Run 🛠️

Easiest way to compile is use Visual Studio.
Just open project and click build and then run.
Program will automatically detect your device.
Program will automatically close when you disconnect gamepad.
⚠️ You may need to "Run as administrator" to use xbox gamepad in some applications (e.g. Task Manager).

Future improvements 💡

  • Alert if low energy