Device_InputButtonPressed
Skip to content
mnscript
Device_InputButtonPressed(InputButtonDevice, Player, string) 

Description ​

Invoked when a connected Input Button device is pressed

Arguments ​

InputButtonDevice - The InputButtonDevice which was pressed
Player - The Player who pressed the button
string - The input from the player

Example ​

msc
using Console;
using Event;
using Player;
using Device;

function OnInputButtonPressed(InputButtonDevice button, Player player, string text){
    Console.WriteLine(button.GetName().." was pressed!");
    Console.WriteLine(player.GetName().." sent: "..text);
}

Event.AddListener("Device_InputButtonPressed", "input button", "OnInputButtonPressed");