User Tools


reference:various_inputs_toy-con

Various Inputs (Toy-Con)

XCTRLSTYLE MaxNumberOfConnections,100,Toy-ConTypeLeft1,Toy-ConTypeRight1[,ConnectionDialogFlag ]
XCTRLSTYLE MaxNumberOfConnections,100,Toy-ConTypeLeft1,Toy-ConTypeRight1,Toy-ConTypeLeft2,Toy-ConTypeRight2[,ConnectionDialogFlag ]

Configure Toy-Con connection settings

・When using Toy-Con, use an exclusive use style for the operation style.
・Information as a normal Joy-Con can be acquired as equivalent to dual-controller grip in BUTTON, STICK, ACCEL, GYROA, GYROV.
・IR Motion Camera commands cannot be used while Toy-Con is in use.
・The operation result on the connection confirmation display can be confirmed with the RESULT function (1:Success, -1:Cancel).
・Calls from subprograms are ignored.

Arguments

MaxNumberOfConnections

Specify the maximum number of controllers you want to connect: 1 to 2

100

When using Toy-Con, specify 100 for the operation style

Toy-ConType

Set the type of Toy-Con to be recognized separately

Left Right
0 Toy-Con Recognition OFF Toy-Con Recognition OFF
1 × Piano
2 × House
3 △ Motorbike △ Motorbike
4 △ Fishing Rod △ Fishing Rod
5 × Robot
6 Visor ×
7 △ Car △ Car
8 △ Plane △ Plane
9 △ Submarine △ Submarine
10 7,8,9 All of Them 7,8,9 All of Them

・Values marked with x cannot be specified.
・The visor can only be specified on the left.
・Piano, house and robot can only be specified on the right.
・Types marked with △ must be specified for both left and right.
・10 is automatically switched to 7,8,9 by attaching the Vehicle Toy-Con Key.

ConnectionDialogFlag

Specify whether to always show the controller connection display

・If 1 is specified, the controller connection display will be displayed.
・If 0 is specified, the controller connection display is displayed only when the setting is changed.
・0, if not specified.

TCPIANO ControllerID OUT RecognitionFlag[,KeyButtonInformation,DialType,DialRotationAngularVelocity]

Get Toy-Con Piano recognition information

・Sspecifying a Toy-Con type other than 1 in XCTRLSTYLE results in an error.
・Return values after key/button information can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return whether or not the Toy-Con Piano is recognized

・Recognizing with 1, 0 is not recognized.

KeyButtonInformation

Return key/button status of Toy-Con Piano bit by bit

The meaning of each bit is as follows:

bit0 C
bit1 C#
bit2 D
bit3 D#
bit4 E
bit5 F
bit6 F#
bit7 G
bit8 G#
bit9 A
bit10 A#
bit11 B
bit12 C (one octave above)
bit13 Load Button
bit14 Octave Up
bit15 Octave Down
bit16 Play Button
bit17 Record Button

DialType

Dial type inserted in Toy-Con

0 Not Inserted, Cannot be Recognized
1 Bold Line
2 Fine Line
3 Two Lines
4 Middle Line

DialRotationAngularVelocity

Rotational angular velocity when a dial is inserted

・One lap in the clockwise direction is 1.0, and one lap in the counterclockwise direction is -1.0.

TCROBOT ControllerID OUT RecognitionFlag,LimbInformationArray[,Pitch,Roll,Yaw]

Get recognition information of Toy-Con Robot

・An error occurs if XCTRLSTYLE is used without starting Toy-Con Robot recognition.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return a bit value indicating whether each slot of the Toy-Con Robot is recognized

・Recognizing each bit 1 but not 0.

bit0 Right Foot
bit1 Right Hand
bit2 Left Hand
bit3 Left Foot

LimbInformationArray

Return a 2D numeric array containing information for each slot

The meaning of Y and X when the array element is [Y, X] is as follows

Y=0 Right Foot
1 Right Hand
2 Left Hand
3 Left Foot
X=0 Corrected Detection Value: 0 to 1
1 Detection Value Before Correction: 0 to 320
2 Min Correction Value: 0 to 320
3 Max Correction Value: 0 to 320
4 Corresponding Cluster ID

Pitch,Roll,Yaw

Posture angle information with the Toy-Con Robot

・The unit of angle is radian.

Pitch Tilt back and forth. If Toy-Con is tilted to the back, it is positive (value increases)
Roll Tilt left and right. If Toy-Con is tilted to the left, it is positive
Yaw Hip rotation. Rotate counterclockwise to make positive

TCVISOR ControllerID OUT RecognitionFlag,Pitch,Roll,Yaw

Get visor recognition information of Toy-Con Robot

・An error occurs if XCTRLSTYLE is used without recognizing the Toy-Con Robot visor.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return 1 if the visor is recognized correctly, 0 if not.

Pitch,Roll,Yaw

Visor attitude angle information

・It is assumed that the visor is attached to the head.
・The unit of angle is radian.

Pitch Tilt of raising/lowering the visor. If Toy-Con is raised, it is positive (value increases)
Roll Left/right tilt of head. If you tilt your neck to the left, it is positive
Yaw Head rotation. Rotate counterclockwise to make positive

TCHOUSE ControllerID OUT RecognitionFlag,InformationArray

Get Toy-Con recognition information

・An error occurs if XCTRLSTYLE is used without starting Toy-Con recognition.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return whether or not Toy-Con is recognized. Recognizing with 1. Not recognized by 0

InformationArray

Return a 2D numeric array containing information about each slot

The meaning of Y and X when the array element is [Y, X] is as follows

Y=0 Bottom Slot
1 Left Slot
2 Right Slot

・The type of block inserted as follows is stored at X=0.

0 No Block
1 Crank Block
2 Button Block
3 Key Block
4 Cable 1
5 Cable 2

・After X=1, the following values are stored.

X Crank Block Button Block Key Block Other
1 Rotation Speed Flag Flag 0
2 0 Push Amount Twist Amount 0
3 0 0 Insertion Direction 0

・The rotation speed of the Crank Block is a value of -1 to 1, and is stationary at 0.
・Button Block flags are as follows.

bit0 Pressed
bit1 Moment of Pressing

・The push amount of Button Block is 0 to 1.0. 0 is not pressed at all.
・The Key Block flag is at the moment the knob is released with 1 and is not released with 0.
・The twist amount is 0 to 1.0. 0 is not twisted at all.
・Insertion direction is 0 or other, and displays whether the Key Block is inserted vertically or horizontally.

TCFISHING ControllerID OUT RecognitionFlag[,FishingRodYaw,FishingRodPitch,ReelSpeed,FishingRodYawAngle,FishingRodPitchAngle]

Get recognition information for Toy-Con Fishing Rod

・An error occurs if XCTRLSTYLE is used without starting to recognize Toy-Con Fishing Rod.
・Return values after fishing rod yaw can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return whether or not the Toy-Con Fishing Rod is recognized. Recognizing with 1. Not recognized by 0

・The recognition method is to mount the left and right Joy-Con on the Toy-Con Fishing Rod and keep it stationary until the recognition flag returns 1.

FishingRodYaw

Get the fishing rod's yaw (left and right angle) as a value between -1.0 and 1.0

・Left is a positive value, right is a negative value, 0 is center.
・Gradually return to 0 even if left and right are not moved.

FishingRodPitch

Get the fishing rod pitch (up and down angle) with a value between -1.0 and 1.0

・Upward is a positive value, downward is a negative value, 0 is horizontal.

ReelSpeed

Get reel winding speed

・Hold the fishing rod and turn it away from you, it'll be a positive value. When turn it towards you, it'll be a negative value, 0 is stationary.
・It becomes 1.0 in one round.

FishingRodYawAngle

Get the yaw (left and right angle) of the fishing rod in radians

・Left is positive value, right is negative value, 0 is center.
・Gradually return to 0 even if left and right are not moved.

FishingRodPitchAngle

Get the fishing rod pitch (up and down angle) in radians

・Upward is a positive value, downward is a negative value, 0 is horizontal.

TCBIKE ControllerID OUT RecognitionFlag[,HandleTilt,AccelAmount,AccelAngle,WheelieAngle]

Get the recognition information of Toy-Con Motorbike

・An error occurs if XCTRLSTYLE is used without recognizing the Toy-Con Motorbike.
・Return values after HandleTilt can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return whether or not the Toy-Con Motorbike is recognized and the state of the operation button as a bit value

0 Unrecognized
bit0 Recognizing
bit1 Brake Lever
bit2 Left Front Button
bit3 Right Front Button

・Recognition method is to put the left and right Joy-Con on the Toy-Con Motorbike and keep them stationary until the recognition flag returns a value other than 0.
・If it is not recognized, the button status is always 0.

HandleTilt

Get the amount of handlebar tilt with a value between -1.0 and 1.0

・Tilt to the left for positive values, tilt to the right for negative values, 0 for horizontal.

AccelAmount

Get the amount of accelerator twist with a value between 0 and 1.0

・Return 0 when not twisted.

AccelAngle

Get accelerator twist angle in radians

・Return 0 when not twisted.

WheelieAngle

Get the angle in radians when the Toy-Con Motorbike is facing up

TCCAR ControllerID OUT RecognitionFlag[,Accelerator,WheelInput[,WheelAngle,LeftLever,RightLever,Cord,SideLever,LeftGimmick,RightGimmick]

Get recognition information of Toy-Con Car

・An error occurs if 7 or 10 is not specified for Toy-Con type in XCTRLSTYLE.
・Return values after the accelerator can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return a bit value indicating whether the car Toy-Con is recognized and the state of the operation button.

0 Unrecognized
bit0 Recognizing
bit1 Vehicle Toy-Con Key Button

Accelerator

Toy-Con Pedal depression: 0 to 1.0

WheelInput

Wheel rotation amount: -1.0 to 1.0

・-1.0 is 180 degrees to the left, 1.0 is 180 degrees to the right, 0 is straight.
・The upper and lower limits are maintained even if the wheel is rotated 180 degrees or more.

WheelAngle

Wheel rotation angle: -0.5 to 0.5

・-0.5 is 180 degrees to the left, 0.5 is 180 degrees to the right, 0 is straight.
・The value is reversed when the wheel is rotated 180 degrees or more.

LeftLever

Operation amount of the left lever: 0 to 1.0

RightLever

Operation amount of the right lever: 0 to 1.0

Cord

Cord pull amount: 0 to 1.0

SideLever

Operation amount of the side lever: 0 to 1.0

LeftGimmick,RightGimmick

Gimmick dial position of the left and right lever: 0 to 4

TCPLANE ControllerID OUT RecognitionFlag[,Accelerator,StickX,StickY]

Get recognition information of Toy-Con Plane

・An error occurs if 8 or 10 is not specified for Toy-Con type in XCTRLSTYLE.
・Return values after the accelerator can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return the bit value of whether the operation Toy-Con Plane is recognized and the state of the operation button.

0 Unrecognized
bit0 Recognizing
bit1 Vehicle Toy-Con Key Button
bit2 Trigger Button

Accelerator

Toy-Con Pedal depression: 0 to 1.0

StickX

Tilt in the left and right direction of the Stick: -1.0 to 1.0

・-1.0 is all the way to the left, -1.0 is all the way to the right, 0 is center.

StickY

Tilt in the back and forth direction of the Stick: -1.0 to 1.0

・-1.0 is farthest from you, -1.0 is closest, 0 is center.

TCSUBM ControllerID, OUT RecognitionFlag[,Accelerator,LeftWheelAngle,RightWheelAngle]

Get recognition information of Toy-Con Submarine

・An error occurs if 9 or 10 is not specified for Toy-Con type in XCTRLSTYLE.
・Return values after the accelerator can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return the bit value of whether or not Toy-Con Submarine is recognized and the state of the operation button.

0 Unrecognized
bit0 Recognizing
bit1 Vehicle Toy-Con Key Button
bit2 Toy-Con Submarine Button

Accelerator

Toy-Con Pedal depression: 0 to 1.0

LeftWheelAngle

Left wheel rotation angle: -0.5 to 0.5

・-0.5 indicates -180 degrees, 0.5 indicates 180 degrees.
・The value is reversed when the wheel is rotated 180 degrees or more.

RightWheelAngle

Right wheel rotation angle: -0.5 to 0.5

・-0.5 indicates -180 degrees, 0.5 indicates 180 degrees.
・The value is reversed when the wheel is rotated 180 degrees or more.

TCVEHICLE(ControllerID)

Return the currently recognized DriveKit Toy-Con type

・If XCTRLSTYLE is not set to use Toy-Con, an error occurs.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

Toy-ConType

One of the following values:

0 Unrecognized
7 Car
8 Plane
9 Submarine

・Return a value other than 0 only when Toy-Con type 7, 8, 9, 10 is specified in XCTRLSTYLE.

reference/various_inputs_toy-con.txt · Last modified: 2023/12/07 15:55 (external edit)

Page Tools