How tylemagne/gopher360 works
Project type and purpose
• Gopher360 is a standalone Windows desktop utility (open-source tool) written in C++, packaged as a Visual Studio solution.
• Its goal is to capture Xbox/PlayStation controller input via XInput (or an emulation layer) and translate those events into standard keyboard and mouse events so that any application or game can be controlled from a couch.
File structure
Top-level:
• Configs/ – sample and default .ini files, documentation for custom button-to-key mappings.
• README.md, LICENSE – project description, build & usage instructions, GPL license.
• Windows/ – Visual Studio solution, C++ source and header files, resource files for the Gopher executable.
Inside Windows/:
• Gopher.sln / .vcxproj* – Visual Studio project files.
• CXBOXController.{cpp,h} – wraps XInput for reading controller state.
• ConfigFile.{cpp,h} – reads/writes config .ini, exposes mapping data.
• Convert.h – mapping logic from controller codes to virtual key codes.
• Gopher.{cpp,h}, main.cpp – core event loop, orchestration of input→mapping→output.
README for additional insights
• Describes supported controllers (X360, XOne, DualShock via emulation).
• Explains default bindings and how users can rebind via config.ini.
• Lists external dependencies (Visual C++ 2015 runtime, optional DS3Tool or DS4Windows for PS controllers).
1. Controller Device (Xbox360/Xbone/DS)
2. XInput / Emulation Layer (Input API)
3. CXBOXController Module (Input Reader)
4. Config Manager (ConfigFile Module + Configs folder)
5. Mapping Engine (Convert Module)
6. Core Orchestrator (Gopher class + main event loop)
7. Output Generator (Win32 SendInput, mouse_event calls)
8. Target Application (Any PC app/game)
• Controller → XInput API (poll controller state)
• XInput API → CXBOXController (encapsulate raw input)
• CXBOXController + Config Manager → Mapping Engine (lookup button→key mapping)
• Mapping Engine → Output Generator (emit virtual keyboard/mouse events)
• Output Generator → OS Input Subsystem → Target Application
c. Architectural patterns and principles:
• Modular layering: separation of input capture, configuration, mapping, and output.
• Adapter (CXBOXController adapts XInput to a common interface).
• Single event-driven processing loop in Gopher.
d. Key technologies/frameworks:
• XInput / DirectX SDK (Xbox controllers)
• Optional DS3Tool/DS4Windows (DualShock emulation)
• Win32 Input Simulation APIs (SendInput, mouse_event)
• INI parsing (ConfigFile)
• Visual C++ 2015 runtime