void checkvJoyDevice() { uint vjid = (uint)joyIDSelector.Value; joystat = joy.GetVJDStatus(vjid); switch (joystat) { case VjdStat.VJD_STAT_FREE: setStat(stat.VJDevReady); tooltiper.SetToolTip(imgStatvJoyDev, "Selected vJoy ready to be used"); break; case VjdStat.VJD_STAT_OWN: setStat(stat.VJDevReady); tooltiper.SetToolTip(imgStatvJoyDev, "Selected vJoy attached"); break; case VjdStat.VJD_STAT_BUSY: setStat(stat.VJDevReady, 0); tooltiper.SetToolTip(imgStatvJoyDev, "Selected vJoy attached to other feeder (" + System.Diagnostics.Process.GetProcessById(joy.GetOwnerPid((uint)joyIDSelector.Value)).ProcessName + ", process ID: " + joy.GetOwnerPid((uint)joyIDSelector.Value) + ")"); break; case VjdStat.VJD_STAT_MISS: setStat(stat.VJDevReady, 0); tooltiper.SetToolTip(imgStatvJoyDev, "Selected vJoy doesn't exist"); break; default: setStat(stat.VJDevReady, 0); tooltiper.SetToolTip(imgStatvJoyDev, "vJoy general error"); break; } btnJoyAttach.Enabled = checkStat(stat.VJDevReady) ? true : false; //Thread thread = new Thread(new ThreadStart(checkvJoyDeviceInputs)); //thread.Start(); //uncomment this and delete next if vjoy change its max /*for (int i = 0; i < 8; i++) { //8 axis * if (joy.GetVJDAxisExist(vjid, (HID_USAGES)((int)HID_USAGES.HID_USAGE_X + i))) { //HID_USAGE_X is 1st * setMLData(i, maplistsub.Available, "Yes"); * setMLData(i, maplistsub.Min, 0); * setMLData(i, maplistsub.Max, 32767); //remove const from here, use joy.GetVJDAxisMax() * } else { * setMLData(i, maplistsub.Available, "No"); * setMLData(i, maplistsub.Min, "Unknown"); * setMLData(i, maplistsub.Max, "Unknown"); * } * }*/ setMLData("mlAX", maplistsub.Available, joy.GetVJDAxisExist(vjid, HID_USAGES.HID_USAGE_X) ? "Yes" : "No"); setMLData("mlAY", maplistsub.Available, joy.GetVJDAxisExist(vjid, HID_USAGES.HID_USAGE_Y) ? "Yes" : "No"); setMLData("mlAZ", maplistsub.Available, joy.GetVJDAxisExist(vjid, HID_USAGES.HID_USAGE_Z) ? "Yes" : "No"); setMLData("mlARX", maplistsub.Available, joy.GetVJDAxisExist(vjid, HID_USAGES.HID_USAGE_RX) ? "Yes" : "No"); setMLData("mlARY", maplistsub.Available, joy.GetVJDAxisExist(vjid, HID_USAGES.HID_USAGE_RY) ? "Yes" : "No"); setMLData("mlARZ", maplistsub.Available, joy.GetVJDAxisExist(vjid, HID_USAGES.HID_USAGE_RZ) ? "Yes" : "No"); setMLData("mlAS0", maplistsub.Available, joy.GetVJDAxisExist(vjid, HID_USAGES.HID_USAGE_SL0) ? "Yes" : "No"); setMLData("mlAS1", maplistsub.Available, joy.GetVJDAxisExist(vjid, HID_USAGES.HID_USAGE_SL1) ? "Yes" : "No"); int povn = joy.GetVJDContPovNumber(vjid); bool povd = false; if (povn < 1) { povn = joy.GetVJDDiscPovNumber(vjid); povd = true; } for (int i = 0; i < 4; i++) { setMLData("mlP" + (i + 1), maplistsub.Available, povn >= (i + 1) ? "Yes" : "No"); setMLData("mlP" + (i + 1), maplistsub.Direction, povn >= (i + 1) ? povd ? "4-way" : "Continuous" : "Unknown"); setMLData("mlP" + (i + 1), maplistsub.Max, povn >= (i + 1) ? povd ? "3" : "35999" : "Unknown"); } int butn = joy.GetVJDButtonNumber(vjid); for (int i = 1; i < 33; i++) { setMLData("mlB" + i, maplistsub.Available, butn >= i ? "Yes" : "No"); } refreshStatusIcons(stat.VJDevReady); }