Giter VIP home page Giter VIP logo

ucr's Introduction

UCR - Universal Control Remapper

THIS AHK VERSION OF UCR IS BEING PHASED OUT! PLEASE START TO MIGRATE TO THE NEW C# VERSION

ScreenShot

DO NOT Use the green "Download" button at the top of this page

IMPORTANT NOTES ON XBOX CONTROLLERS!

GENERAL

UCR does not currently support remapping of a physical Xbox controller.
That is to say, if you wish to alter how a game sees a physical Xbox controller, you cannot currently do this.
This may be possible in the future via Nefarius' HidGuardian project.
Reading input from an Xbox controller and sending output to vJoy etc is fine.
Reading input from a non-Xbox stick and emulating an Xbox controlelr is fine.

Input (Reading state of your XBox controller)

  1. There is no "Bind Mode" for Xbox controllers, you must select from the menu to enable XInput support.
  2. Some Xbox controller variants (One, Elite, Accessibility) will only work in Xinput mode.
    If Xbox controllers stop working while UCR is not active, then you are not using XInput mode! Select from the menu, don't use Bind Mode!

Output (Emulating Xbox controllers)

For Virtual XBox controllers to work, you must:

  1. Install the latest version of vJoy from http://vjoystick.sourceforge.net/
  2. On first run of UCR, check the vJoy log to make sure vJoy loaded OK
    From the UCR main menu: IOClasses -> vJoy -> Show vJoy log
  3. If all went well, install the SCPVBus:
    From the UCR main menu: IOClasses -> vJoy -> Install SCPVBus
    If this step fails, open an admin command prompt and navigate to UCR's resources folder, there are .bat files in there

About

The aim of UCR is to allow end-users to easily leverage the power of AHK without having to learn to code.
At it's basest level, think of it as a way for an end-user to run a number of scripts written by various people, and manage when each script runs, what keys trigger it's functions, tweak each script's parameters, etc - solely by using a GUI application. The primary target audience is gamers, UCR is intended to be able to replicate the functionality that comes with programmable keyboards / mice / joysticks etc.

Profiles

UCR supports profiles. A number of plugins can be grouped together into a Profile.
Profiles can also have child profiles, and child profiles can "inherit" the plugins of a parent profile.
This can be used to create "Shift states" to switch the functionality of inputs.
In the future, it is also planned to allow profiles to be linked to a specific application - when that application gets the focus, the profile becomes active.

Command line profile switching

Profiles can be changed through command line parameters when launching UCR through the CLI tool and subsequently to change the profile of the running instance. The syntax for profile switching is UCR.exe CLI.ahk <ParentProfile> <ChildProfile>. There are three different methods for changing profiles using the syntax. Passing a valid profile GUID as the <ParentProfile> will find and activate the profile. Passing a string, quoted or unquoted, as <ParentProfile> will select the first profile matching <ParentProfile> (all matches are case insensitive). Passing both <ParentProfile> and <ChildProfile> will find and select a profile matching the <ChildProfile> name with a parent profile matching the <ParentProfile> name. The <ParentProfile> will be selected as fallback if no <ChildProfile> is found. Example: UCR.exe CLI.ahk "MAME" "megaman"

Plugins

At the core of the design of UCR is the idea of an AHK script as a "Plugin".
From an end-user's perspective, a plugin is a widget which can perform a small task - eg remap one key to another.
From a plugin author's point of view, a plugin is simply a text file containing AHK script. The script contains an AHK class that derives from a base class which is part of the UCR source code.
Each instance of each plugin gets it's own GUI inside the UCR app when added by a user. The GuiControls in the Gui can easily be made persistent across runs and you can add special GuiControls that allow the end-user to select the inputs (eg hotkeys) and outputs to configure your script. There are varios provided methods and mechanisms to get notification of events (eg the profile containing the plugin went active or inactive)
Pretty much anything that you could normally put in an AHK class should work inside a plugin.

Persistent GuiControls

Plugins can call UCR methods to add a GuiControl to their Gui whose value will be remembered between runs of UCR.
It can be used to allow the end user to tweak the behavior of the plugin that it is part of.

Inputs and Outputs

Plugins may also contain special GuiControls that allow the end user to bind inputs and outputs.
Valid inputs are: Keyboard, Mouse, Joystick.
Valid outputs are: Keyboard, Mouse, vJoy Virtual Joystick (Inc virtual XBox), Titan One hardware
More inputs and output types can be added through the "IOClass" system - Each IOClass can add items to the UCR Main menu, handles adding of menu items to the Input/Output GuiControls, and handles processing of input and output (eg Calling DLLs).

Requirements

If you are a typical end-user of UCR, you just need to download the zip from the releases page, unzip it and double-click UCR.exe. No installation is required, and you do not need to install AutoHotkey.

In order to run UCR un-compiled: Install AutoHotkey, then take a copy of UCR.exe from the download zip, rename it AutoHotkey.exe and place it in your AutoHotkey install folder. Optionally back up the old AutoHotkey.exe, but the files named like AutoHotkeyA32.exe in your AHK folder are already backups of the normal AHK executables.

Debugging UCR

A major design goal of UCR is to make it (and plugins) debuggable.
Development is currently done using SciTE4AutoHotkey, so if you wish to debug UCR or a plugin, that is the advised solution.
Currently the relased version of SciTE4AutoHotkey does not support breakpoints in plugins etc properly, but Lexikos has a fix for this, and I posted instructions [here](https://autohotkey.com/boards/viewtopic.php?p=111383# p111383) on how to apply the fix.
UCR's code avoids the use of SetTimer, OnMessage etc in the main thread wherever possible, so that "stepping in" in the debugger does not end up dropping you into some random timer pseudo-thread. In general, it works around these situations by offloading any code that might interfere with the debugging process to a worker thread.

Debugging Plugins

If you wish to be able to set breakpoints within a plugin, then you must do the following:
Edit UCRDebug.ahk and place a line like # include Plugins\User\MyPlugin.ahk at the end.
Also, make sure the line # Include *iUCRDebug.ahk in UCR.ahk is not commented out.
This makes the debugger aware of the plugin, and allows you to place breakpoints within it.
You may debug any number of plugins in this way.

Documentation

Please see the Wiki.

ucr's People

Contributors

davefb avatar docacola avatar evilc avatar snoothy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ucr's Issues

Split _BindObject class up for Input / Output ?

Maybe Inputs and Outputs should be separate classes, both derived from a common parent.
Output class does not need .block, .wild etc
Also setting of .IsVirtual for output buttons seems clumsy at the moment.
Maybe have buttons / axes etc derive from a parent object, and if parent object is output type, creating a joystick button child automatically derives a class with IsVirtual set to true, as output joystick buttons would always be virtual.

Mouse wheel interferes with bind guicontrols

When scrolling the plugin list, it is very easy to inadvertently change options in a bind guicontrol, including "Select New Binding".
Ideally, mouse wheel should have no effect on these windows.

Not sure if this is a result of our scrollbar code in AHK source, or just a fact of life.

Implement plugin communication channels

It would be nice if one plugin were reliably able to "find" another plugin, regardless of the name of the plugin.
ie, some way to create a "global variable" of sorts, that points to yourself.
If a plugin advertises itself on a named "channel", then any other plugin wired to use that channel can call methods of that class.
This would allow adding a class library as a global plugin, enabling it's use by other plugins. The power of GDip, AHKHID, vJoy etc could all be added or removed whilst allowing multiple scripts to access the same instance of the class library simultaneously.
May require the use of SafeObjects etc to ensure strange things don't happen.

Joystick mappings not getting removed on plugin delete?

Observed:
Created an AxisToAxis plugin, map axis x to vjoy axis x
worked ok
deleted plugin, recreated new plugin with same settings.
noticed how vjoy output flickered
seems like 2 things trying to set value?
Dont seem able to repro

Implement libraries system

Allow script authors to reference libraries (eg vJoy, GDI+)

eg UCR.Libraries.vJoy.SetAxis(1,1)

This will allow plugins to use libraries, without having to have multiple instances of the same library in memory.

Will need to add a "dependencies" property for plugins, so UCR can tell what libraries a plugin needs.

Implement QuickBind equivalent

Some method is required to bind virtual joysticks to game functions without them seeing the physical inputs.

Maybe some way to enter a mode where all mappings are delayed by a couple of seconds, enough time to hit a "select binding" option in a game.

Bind Mode is sluggish

This is due to the fact that in order to enter bind mode, the following things need to be done:

All active hotkeys turned off
Hotkeys for all keys on the keyboard, mouse, and all joystick buttons (8 * 32) must be declared.

Then, when the user chooses a key, the same must be done, but in reverse.

The plan is to use multiple threads (One for active hotkeys, one for bind mode) and suspend each one as appropriate.

Make all thread scripts able to run un-threaded

Unit tests of thread scripts would be easier to rig up and debug if everything ran in one thread.
Add logic to the thread scripts to decide whether or not to dereference vars or use AHKExec

Add state property to hotkeys

the script author should be able to determine the state (up, down) of a bound hotkey.
Use same property name as the one that holds the state of an axis?

Implement Text-To-Speech library

Something plugins can call to easily speak text.
Also maybe manage multiple voices? queue them? priorities?
Use Libraries system?

Add per-profile options + profile chrome

Profiles will need to have a "chrome" surround like plugins do - to hold per-profile options.
Limiting hotkeys to applications will be per-profile, so the GUI for that will need to go in the profile chrome.

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.