Skip to content

A small python3 programm to map shell commands and python3 code to your controller through the inputs library

License

Notifications You must be signed in to change notification settings

Polyfish0/command-mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Command Mapper

A small python3 programm to map shell commands and python3 code to your controller through the inputs library

Usage

  1. Grab the latest version of Command Mapper from the releases tab and unzip it to a folder
  2. Install python 3 (i use python 3.9) and execute pip install -r requirements.txt
  3. Now simply run the programm with python main.py

Bindings

You can edit your bindings in the inputs.json file
When a command starts with (@PY) it will be executed as python 3 code else it will be executed as a shell command.

Button Mapping

Button Name XBox One
BTN_SOUTH A
BTN_NORTH Y
BTN_WEST X
BTN_EAST B
BTN_SELECT Bottom right of XBox Logo
BTN_START Bottom left of XBox Logo
BTN_THUMBR Right thumbstick click
BTN_THUMBL Left thumbstick click
BTN_TR RB
BTN_TL LB
ABS_HAT0Y DPad up and down
ABS_HAT0X DPad left and right

Example

{
  "BTN_SOUTH": [
    "git init",
    "(@PY)print(\"South\")"
  ],
  "BTN_WEST": [
    "(@PY)print(\"West\")"
  ]
}

Credits

Inputs by zeth used to acces the controller inputs: https://github.com/zeth/inputs