Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Makcu

A lightweight C++ library for interfacing with the MAKCU ESP32-based HID input device over serial (COM port). Supports mouse movement, button input, and auto-detection of the device via VID/PID.

Requirements

  • Windows 10/11
  • MSVC (Visual Studio 2019+)
  • MAKCU device (VID 1A86, PID 55D3)

Setup

  1. Clone or copy Makcu.hpp and Makcu.cpp into your project.
  2. setupapi.lib is linked automatically via #pragma comment in the header.
  3. Call c_Makcu::Initialize() before any other function.

API Reference

Lifecycle

bool c_Makcu::Initialize();    // Auto-detects and opens the MAKCU COM port
void c_Makcu::Shutdown();      // Closes the port
bool c_Makcu::IsInitialized();

Commands

bool c_Makcu::SendCommand(const std::string& cmd); // Send raw Legacy API command, waits for response
bool c_Makcu::SendNoWait(const std::string& cmd);  // Send raw Legacy API command, no response wait

Mouse Movement

bool c_Makcu::Move(int x, int y); // Relative move

Mouse Buttons

// Individual down/up
bool c_Makcu::LeftDown();   bool c_Makcu::LeftUp();
bool c_Makcu::RightDown();  bool c_Makcu::RightUp();
bool c_Makcu::MiddleDown(); bool c_Makcu::MiddleUp();
bool c_Makcu::Side1Down();  bool c_Makcu::Side1Up();
bool c_Makcu::Side2Down();  bool c_Makcu::Side2Up();

// Single click (down + up in one call)
bool c_Makcu::LeftClick();
bool c_Makcu::RightClick();
bool c_Makcu::MiddleClick();
bool c_Makcu::Side1Click();
bool c_Makcu::Side2Click();

// Scroll
bool c_Makcu::Scroll(int delta); // +1 = up, -1 = down

Example

#include "Makcu.hpp"
#include <iostream>

int main()
{
    if (!c_Makcu::Initialize())
    {
        std::wcout << L"Failed to initialize MAKCU\n";
        return 1;
    }

    while (true)
    {
        if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
            break;

        if (GetAsyncKeyState('O') & 0x8000)
            c_Makcu::Move(5, 0);

        Sleep(1);
    }

    c_Makcu::Shutdown();
    return 0;
}

Notes

  • All hot-path functions (Move, button down/up, click, etc) use SendNoWait — fire-and-forget serial writes with no blocking read.
  • SendCommand blocks waiting for a response — don't call it on a hot path.
  • The device is auto-detected by VID/PID (VID_1A86&PID_55D3) so no manual COM port configuration is needed.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages