Exemple #1
0
        public Dictionary <string, string> GetInfo() // Just for testing
        {
            Dictionary <string, string> info = new Dictionary <string, string>();

            if (Vjoy.vJoyEnabled())
            {
                info["Vendor"]  = Vjoy.GetvJoyManufacturerString();
                info["Product"] = Vjoy.GetvJoyProductString();
                info["Serial"]  = Vjoy.GetvJoyVersion().ToString(); // Why are serial and version backwards??
                info["Version"] = Vjoy.GetvJoySerialNumberString();

                UInt32 DllVer = 0, DrvVer = 0;
                info["Driver Match"]      = Vjoy.DriverMatch(ref DllVer, ref DrvVer).ToString();
                info["Number of Buttons"] = Vjoy.GetVJDButtonNumber(_vJoyNumber).ToString();

                uint    id     = 1; // First device is 1 (not 0) - there is also no way to check for the number of devices (at least that I can find).
                VjdStat status = Vjoy.GetVJDStatus(id);
                switch (status)
                {
                case VjdStat.VJD_STAT_OWN:
                    info["Status"] = "vJoy Device " + _vJoyNumber + " is already owned by this feeder";
                    break;

                case VjdStat.VJD_STAT_FREE:
                    info["Status"] = "vJoy Device " + _vJoyNumber + " is free";
                    break;

                case VjdStat.VJD_STAT_BUSY:
                    info["Status"] = "vJoy Device " + _vJoyNumber + " is already owned by another feeder";
                    break;

                case VjdStat.VJD_STAT_MISS:
                    info["Status"] = "vJoy Device " + _vJoyNumber + "  is not installed or disabled";
                    break;

                default:
                    info["Status"] = "vJoy Device " + _vJoyNumber + " general error";
                    break;
                }
            }
            else
            {
                info["Status"] = "vJoy driver not enabled: Failed Getting vJoy attributes";
            }
            return(info);
        }