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

Is the 3DS hardware accessible from this? #11

Open
cr8ivecodesmith opened this issue Aug 1, 2020 · 1 comment
Open

Is the 3DS hardware accessible from this? #11

cr8ivecodesmith opened this issue Aug 1, 2020 · 1 comment

Comments

@cr8ivecodesmith
Copy link

Like capturing input from the buttons, drawing graphics, access to storage, etc?

@vbe0201
Copy link
Owner

vbe0201 commented Oct 23, 2020

Yes and no. It is a planned feature to extend the Python standard library that ships with 3DS.py releases by a ctru module which wraps the libctru APIs into a more idiomatic, higher-level Python API. This will allow you to do all the things you're looking for. It is designed to build upon a C module called _ctru which provides lower-level abstractions with a similar goal

However, that part of the project is currently in a very early state where only a barebones _ctru module is fleshed out.
https://github.com/vbe0201/3DS.py/blob/master/python_patches/_ctru/_ctrumodule.c#L471 is a list of functions that are currently functional within Python.

If you don't consider it a problem to eventually have to read the code of the _ctru module and the libctru docs, you could always use that as well:

import _ctru

# Bitmasks of all the keys.
A = 1 << 0
B = 1 << 1

while True:
    input = _ctru.hid_keys_down()
    if input & A == A:
        print("A pressed!")

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