joycontrol icon indicating copy to clipboard operation
joycontrol copied to clipboard

Usage as python module functions

Open Tetsujinfr opened this issue 5 years ago • 1 comments

hi

first, thanks for this piece of work, this is amazing and continuously improved!

I am trying to use a joycon controller with a Jetson device, as a nice input device for some interface (not related to gaming emulation). I had a quick look at the run_controller_cli.py code but I am not sure if I can use it as is to get joycon button/stick values and how. I am not a pro developer.

Is it possible to read the joycon input status with functions like the below from the already existing code or do I need to write some wrapping python functions separately?

import joyconlib as jc

a= jc.returnInputValue(device_id="JOYCON_L", input_id="BUTTON_ZL")
if a==True then ...

thanks a lot

Tetsujinfr avatar Jun 20 '20 15:06 Tetsujinfr

You cannot use it as is. However you can use all of the functions it is using. I wanted to be able to use my keyboard and expanded it to controller and Replay.

This script may work for you already https://github.com/indykoning/joycon-controller/blob/master/input/GamepadControl.py https://github.com/indykoning/joycon-controller/blob/master/SwitchController.py#L163

If you want to make it your own or change it keep in mind that i have made some abstractions to all the functions.

indykoning avatar Dec 19 '20 21:12 indykoning