$ show KeyPuncher/WiinUPro
This repository provides two Windows desktop applications (WiinUPro and WiinUSoft) that allow users to connect Nintendo controllers (Wiimote, Nunchuk, Classic Controller, Pro Controller, Joy-Con, GameCube) and PlayStation controllers (DS3, DS4) to a PC, emulating Xbox 360 controllers (XInput) or other outputs like keyboard/mouse and vJoy virtual joystick. The architecture is a hybrid of C# WPF applications, a C++ kernel-mode virtual bus driver (ScpVBus.sys), and a C++ XInput wrapper DLL. The core logic is split into several libraries: NintrollerLib for parsing Nintendo controller protocols, ScpControl for Bluetooth/USB communication with PS3/PS4 controllers, and a Shared project with common utilities. The applications feature interactive controller visualizations, calibration tools, profile management, and localization support. The codebase is functional but shows signs of organic growth and technical debt. There are two overlapping applications (WiinUPro and WiinUSoft) with similar functionality, suggesting an incomplete migration. The kernel driver is provided as a precompiled binary without source, and the project targets .NET Framework 4.0 with legacy dependencies like SharpDX. Hardcoded magic numbers, commented-out code, and TODO comments are prevalent. Despite these issues, the repository demonstrates deep knowledge of controller protocols and provides a working solution for a niche use case. It is maintained sporadically by a single developer, with the last commit dated 2026-05-07 (likely a placeholder).
The LLM identified 5 files worth highlighting for reuse:
Central class for Nintendo controller communication. Provides a unified interface for Wiimote, Nunchuk, Classic Controller, Pro Controller, and other extensions. Handles Bluetooth HID report parsing, extension detection, and state updates. Reusable as a standalone library for any project needing to read Nintendo controller inputs on Windows.
Implements a JSON-based translation system used by both WiinUPro and WiinUSoft. Provides methods to load language files, apply translations to WPF controls, and format strings. Self-contained and easily extractable for any .NET application needing runtime localization.
Interface defining the contract for input-to-output assignments. Concrete implementations (KeyboardAssignment, MouseAssignment, XInputButtonAssignment, VJoyButtonAssignment, etc.) encapsulate the logic for simulating different output types. This pattern allows clean separation of mapping logic and is reusable in any input remapping application.
Abstract base class for all controller visual controls (WiiControl, ProControl, JoyConLControl, etc.). Provides common functionality: context menus for quick assignment, input highlighting, tooltip management, calibration integration, and event passthroughs. Demonstrates a reusable pattern for building interactive controller UIs in WPF.
Defines structs for controller components (CoreButtons, Joystick, Accelerometer, IR, Trigger) with built-in normalization, deadzone, and anti-deadzone logic. Implements INintrollerParsable and INintrollerNormalizable interfaces. These structs are self-contained and can be reused in any project that needs to process raw controller data with calibration.