3DS.py icon indicating copy to clipboard operation
3DS.py copied to clipboard

Is the 3DS hardware accessible from this?

Open cr8ivecodesmith opened this issue 5 years ago • 1 comments

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

cr8ivecodesmith avatar Aug 01 '20 06:08 cr8ivecodesmith

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!")

vbe0201 avatar Oct 23 '20 15:10 vbe0201