sys-script allows you to run Janet scripts on your Switch.
TODO: Fully flesh out this section
sys-script's Title ID is 4200736372697074
.
On startup, your Switch will execute sdmc:/script/main.janet
, outputting logs
in sdmc:/script/log
.
Closes (frees) the event ev
.
Waits for the firing of event ev
.
Fetches n
keyboard states, where n
is max
if it is present, otherwise it
is 1
. Returns a table that looks like
@{
:sampling-number 0x################
:modifiers 0x################
:keys @[
0x################
0x################
0x################
0x################
]
}
This table should directly match https://switchbrew.github.io/libnx/structHidKeyboardState.html.
Attaches and returns a new virtual controller. type
may be one of
:pro-controller
. interface
may be one of :bluetooth
, :rail
, :usb
.
body
, buttons
, left-grip
, and right-grip
are all numbers in
little-endian RGBA (0xAABBGGRR
).
Detaches a virtual controller.
Sets the buttons of controller
to flags
.
TODO: Document how to figure out your button flags
Sets the joystick stick
of controller
to (x
, y
). stick
may be
:left
or :right
.
Opens a display. id
may be a string. If id
is missing, the default display
will be opened.
Closes disp
.
Returns disp
's VSync event.