Exemplo n.º 1
0
        public override bool Initialize()
        {
            if (isInitialized)
            {
                return(true);
            }

            device_key     = GlobalVarRegistry.GetVariable <DeviceKeys>($"{DeviceName}_devicekey");
            enable_generic = GlobalVarRegistry.GetVariable <bool>($"{DeviceName}_enable_generic");
            enable_ryos    = GlobalVarRegistry.GetVariable <bool>($"{DeviceName}_enable_ryos");

            talkFx     = new TalkFxConnection();
            ryosTalkFx = new RyosTalkFXConnection();

            //Will return true even when no Ryos is connected. Check if TalkFx is opened?
            //Is even requierd for 1 color devices with the used sdk version.
            if (!ryosTalkFx.Initialize())
            {
                LogInfo("Could not initialize Ryos Talk Fx");
                return(isInitialized = false);
            }

            //Will return true even when no Ryos is connected. Check if TalkFx is opened?
            //Is even requierd for 1 color devices with the used sdk version.
            if (!ryosTalkFx.EnterSdkMode())
            {
                LogInfo("Could not Enter Ryos SDK Mode");
                return(isInitialized = false);
            }

            return(isInitialized = true);
        }
Exemplo n.º 2
0
        public IskuFxKeyboardCommunicator(RoccatIskuFxSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            _settings           = settings;
            _keyboardConnection = new TalkFxConnection();
        }
Exemplo n.º 3
0
        public bool Initialize()
        {
            if (!isInitialized)
            {
                try
                {
                    talkFX     = new TalkFxConnection();
                    RyosTalkFX = new RyosTalkFXConnection();

                    if (RyosTalkFX != null)
                    {
                        RyosInitialized = RyosTalkFX.Initialize();
                        RyosInitialized = RyosInitialized && RyosTalkFX.EnterSdkMode();
                    }

                    if (talkFX == null ||
                        RyosTalkFX == null ||
                        !RyosInitialized
                        )
                    {
                        throw new Exception("No devices connected");
                    }
                    if (Global.Configuration.roccat_first_time)
                    {
                        App.Current.Dispatcher.Invoke(() =>
                        {
                            RoccatInstallInstructions instructions = new RoccatInstallInstructions();
                            instructions.ShowDialog();
                        });
                        Global.Configuration.roccat_first_time = false;
                        Settings.ConfigManager.Save(Global.Configuration);
                    }
                    isInitialized = true;
                    return(true);
                }
                catch (Exception ex)
                {
                    Global.logger.Error("Roccat device, Exception! Message:" + ex);
                }

                isInitialized = false;
                return(false);
            }

            return(isInitialized);
        }
Exemplo n.º 4
0
        public bool Initialize()
        {
            if (!isInitialized)
            {
                try
                {
                    talkFX     = new TalkFxConnection();
                    RyosTalkFX = new RyosTalkFXConnection();

                    if (RyosTalkFX != null)
                    {
                        RyosInitialized = RyosTalkFX.Initialize();
                        RyosInitialized = RyosInitialized && RyosTalkFX.EnterSdkMode();
                    }


                    if (talkFX == null &&
                        RyosTalkFX == null &&
                        !RyosInitialized
                        )
                    {
                        throw new Exception("No devices connected");
                    }

                    isInitialized = true;
                    return(true);
                }
                catch (Exception ex)
                {
                    Global.logger.LogLine("Roccat device, Exception! Message:" + ex, Logging_Level.Error);
                    System.Windows.Forms.MessageBox.Show("Roccat device, Exception! Message:" + ex);
                }

                isInitialized = false;
                return(false);
            }

            return(isInitialized);
        }
Exemplo n.º 5
0
        public bool Initialize()
        {
            if (!isInitialized)
            {
                try
                {
                    talkFX     = new TalkFxConnection();
                    RyosTalkFX = new RyosTalkFXConnection();

                    if (RyosTalkFX != null)
                    {
                        RyosInitialized = RyosTalkFX.Initialize();
                        RyosInitialized = RyosInitialized && RyosTalkFX.EnterSdkMode();
                    }


                    if (talkFX == null &&
                        RyosTalkFX == null &&
                        !RyosInitialized
                        )
                    {
                        throw new Exception("No devices connected");
                    }

                    isInitialized = true;
                    return(true);
                }
                catch (Exception ex)
                {
                    Global.logger.Error("Roccat device, Exception! Message:" + ex);
                }

                isInitialized = false;
                return(false);
            }

            return(isInitialized);
        }
Exemplo n.º 6
0
        private static void TalkFxTEst()
        {
            WriteAndWaitForEnter("TalkFX test, press enter to begin");

            using (var connection = new TalkFxConnection())
            {
                connection.SetLedRgb(Zone.Event, KeyEffect.Blinking, Speed.Normal, new Color(255, 105, 180));
                WriteAndWaitForEnter("The keys should now be blinking in a fairly pink color, press enter to continue");

                connection.SetLedRgb(Zone.Event, KeyEffect.On, Speed.Normal, new Color(255, 255, 255));
                WriteAndWaitForEnter("The keys should now be ON and have a white color, press enter to continue");

                connection.SetLedRgb(Zone.Event, KeyEffect.On, Speed.Normal, new Color(0, 0, 0));
                WriteAndWaitForEnter("The keys should now be OFF, press enter to continue");

                connection.SetLedRgb(Zone.Event, KeyEffect.Breathing, Speed.Normal, new Color(255, 0, 0));
                WriteAndWaitForEnter("The keys should now be 'breathing' in a red color, press enter to continue");

                connection.RestoreLedRgb();
            }

            WriteAndWaitForEnter("TalkFX test now finished, press enter to continue");
        }