Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program exiting will leave controllers connected #15

Open
PickleTicklewithnospace opened this issue Sep 16, 2020 · 1 comment
Open

Program exiting will leave controllers connected #15

PickleTicklewithnospace opened this issue Sep 16, 2020 · 1 comment

Comments

@PickleTicklewithnospace

If the program crashes/exits unexpectedly, controllers can be left connected. Is there any way to disconnect these controllers? I noticed I can't restart my computer either so I have to force shutdown every time, but this does disconnect the controllers on restart.

@niluan304
Copy link

It bothers me, too. I try to solve it by import atexit
Like this:

import atexit

vc = pyxinput.vController(False)

@atexit.register
def unPlug():
    print("Virtual Controller UnPlug")
    vc.UnPlug(True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants