Mrcubix / OTD.EnhancedOutputMode

Enhanced output modes for OTD
GNU General Public License v3.0
1 stars 0 forks source link

Enhanced Output Modes for OpenTabletDriver

Features

Supported Versions

Installation

  1. Download the latest release from the releases page
  2. Open the plugin manager in OpenTabletDriver
  3. Drag the downloaded .zip file into the plugin manager

How to Enable Touch

Touch is disabled by default, to prevent any conflict of inputs between the pen and your hand. To enable touch, you can follow these steps:

Touch Settings

Just doing this might not be enough if the touch resolution of your tablet is different from the Wacom CTH tablets, In which case you will need to set these values manually using the following steps:

What about Touch Gestures

For Touch Gestures, see the Touch Gestures Plugin (Available via the Plugin Manager)

Touch Supported Tablets (Tested)

How to make a plugin

Clone the repo into a git submodule with:

git submodule add .modules/OTD.EnhancedOutputMode

Add a reference to the plugin in your project file:

<ItemGroup>
    <ProjectReference Include=".modules/OTD.EnhancedOutputMode/OTD.EnhancedOutputMode.csproj" />
</ItemGroup>

Add a reference to the library in your plugin class:

using OTD.EnhancedOutputMode.Lib;

Make use of any of the 2 interfaces: IGateFilter or IAuxFilter.

Example for IGateFilter:

public class MyPlugin : IFilter, IGateFilter
{
    public Vector2 Filter(Vector2 report)
    {
        return report;
    }

    public bool Pass(IDeviceReport report, ref ITabletReport tabletreport)
    {
        if (tabletreport.Pressure > 0)
        {
            // Affect the input in some way
            return true;
        }
        else
        {
            return false;
        }
    }

    public FilterStage FilterStage => FilterStage.PreTranspose;
}

Example for IAuxFilter:

public class MyPlugin : IFilter, IAuxFilter
{
    public Vector2 Filter(Vector2 report)
    {
        return report;
    }

    public IAuxReport AuxFilter(IAuxReport report)
    {
        return report;
    }

    public FilterStage FilterStage => FilterStage.PreTranspose;
}

Note that you cannot prevent other binds from being triggered, you can mostly only make use of the extra, unused data in the reports, such as, a report from another plugin. (e.g. IWheelReport from the WheelAddon plugin of mine)

When done, build the plugin and drag the dll in the same folder as OTD.EnhancedOutputMode.dll. The reason is that the plugin need to be loaded in the same context as the library in order for the main plugin to make use of it without extra logic needed.