Skip to content

Using Source Version

Max Paperno edited this page Jul 18, 2021 · 4 revisions

Using Plugin Source Code Version

Requirements

  • You will need Python 3.8 or higher, preferably the 64-bit version. Make sure pip is also installed (optional with some installations). Tested with python.org versions (v3.9.5 as of writing) on Windows 10 and MacOS 11).
  • Extra Python module: pyee, and for Windows only, pywin32. You can install these with pip install pyee pywin32 at a console/terminal command line.
  • The source code of this plugin. This can be downloaded from the Releases page, or from the repository home page by clicking the green "Code" button at top right and selecting the "Download zip" option. Or if you're familiar with Git, you can clone the repo.

Setup

Basically everything inside the src folder of this repository is the plugin. For Touch Portal to run it, all you need to do it put the files in the right place and make one small change in the plugin configuration file.

  • Find the Touch Portal plugins folder, which should be:
    • Windows: C:\Users<User_Name>\AppData\Roaming\TouchPortal\plugins
    • MacOS: _\Documents\TouchPortal\plugins_
  • Inside there create a folder named LGKeys (exactly).
  • Copy the contents of the src folder from this plugin to the new LGKeys directory. This directory should now have entry.tp and main.py files in it, along with modules and images folders.
  • Open the entry.tp file in a plain-text editor (Notepad, SimpleText, ... whatever).
  • Look for the plugin_start_cmd entry in this file (it is near the top). It will look like this:
    • "plugin_start_cmd": "%TP_PLUGIN_FOLDER%/LGKeys/lgkeys -l %TP_PLUGIN_FOLDER%/LGKeys/lgkeys.log --tpstart",
  • Change "lgkeys" to "main.py". The new line should look like this:
    • "plugin_start_cmd": "%TP_PLUGIN_FOLDER%/LGKeys/main.py -l %TP_PLUGIN_FOLDER%/LGKeys/lgkeys.log --tpstart",
  • Save the file.
  • (Re)start Touch Portal. It should detect the new plugin and ask you if you'd like to start the command. Say yes, and you should be all set.

Further Details (for experimenters)

You can test the plugin's client by running main.py from the src folder of this repository at a command prompt. For this to work properly, this plugin's src/entry.tp file must already be "installed" in the TP plugins folder as described above.

Touch Portal also needs to be running, but make sure the LGKeys Plugin is stopped from the TP Settings page. You do not want two copies of the client running at the same time.

Alternatively you could even remove the plugin_start_cmd line from the entry.tp file entirely, or you could change the command to point to main.py located in any other folder.

  • To build the plugin distribution or self-contained executable files (like in the released versions), the PyInstaller module is also required (pip install pyinstaller).
  • To install all the required Python modules at once, switch to the build directory of this repository and run
    • pip install -r requirements.txt