Esempio n. 1
0
        public bool Initialize()
        {
            if (!isInitialized && CheckGCPower())
            {
                try
                {
                    keyboard = KeyboardFactory.CreateHIDDevice("hidkeyboard");
                    if (keyboard != null)
                    {
                        bRefreshOnce  = true;
                        isInitialized = true;

                        return(true);
                    }

                    isInitialized = false;
                    return(false);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Uniwill device error!");
                }
                // Mark Initialized = FALSE
                isInitialized = false;
                return(false);
            }


            return(isInitialized);
        }
Esempio n. 2
0
        public bool Initialize()
        {
            if (!isInitialized && CheckGCPower())
            {
                try
                {
                    devicename = KeyboardFactory.GetOEMName();

                    keyboard = KeyboardFactory.CreateHIDDevice("hidkeyboard");
                    if (keyboard != null)
                    {
                        bRefreshOnce  = true;
                        isInitialized = true;
                        //SetBrightness();
                        return(true);
                    }

                    isInitialized = false;
                    return(false);
                }
                catch
                {
                    Global.logger.Error("Uniwill device error!");
                }
                // Mark Initialized = FALSE
                isInitialized = false;
                return(false);
            }

            return(isInitialized);
        }