public void locBtnClick(object sender, EventArgs e) { Button bb = sender as Button; if (bb.Tag.GetType() == typeof(Button)) { Button button = bb.Tag as Button; if (button.Tag.GetType() == typeof(Joycon)) { Joycon v = (Joycon)button.Tag; v.SetDebugPadMsg(); v.SetRumble(20.0f, 400.0f, 1.0f, 300); } } }