Пример #1
0
 /// <summary>
 /// Add a pair of pressed keys to the stats
 /// </summary>
 /// <param name="key_a"></param>
 /// <param name="key_b"></param>
 public static void AddPair(Key key_a, Key key_b)
 {
     int count = 0;
     KeySequence s = new KeySequence() { key_a, key_b };
     m_pair_stats.TryGetValue(s, out count);
     m_pair_stats[s] = count + 1;
 }
Пример #2
0
        static void ReplaceCFG(MethodDef method, List <Tuple <Instruction, uint, IMethod> > instrs, CEContext ctx)
        {
            InjectStateType(ctx);

            var graph    = ControlFlowGraph.Construct(method.Body);
            var sequence = KeySequence.ComputeKeys(graph, null);

            var cfgCtx = new CFGContext {
                Ctx       = ctx,
                Graph     = graph,
                Keys      = sequence,
                StatesMap = new Dictionary <uint, CFGState>(),
                Random    = ctx.Random
            };

            cfgCtx.StateVariable = new Local(ctx.CfgCtxType.ToTypeSig());
            method.Body.Variables.Add(cfgCtx.StateVariable);
            method.Body.InitLocals = true;

            var blockReferences = new Dictionary <int, SortedList <int, Tuple <Instruction, uint, IMethod> > >();

            foreach (var instr in instrs)
            {
                var index = graph.IndexOf(instr.Item1);
                var block = graph.GetContainingBlock(index);

                SortedList <int, Tuple <Instruction, uint, IMethod> > list;
                if (!blockReferences.TryGetValue(block.Id, out list))
                {
                    list = blockReferences[block.Id] = new SortedList <int, Tuple <Instruction, uint, IMethod> >();
                }

                list.Add(index, instr);
            }

            // Update state for blocks not in use
            var done = new HashSet <ControlFlowBlock>();
            var q    = new Stack <ControlFlowBlock>(graph.Where(b => (b.Type & ControlFlowBlockType.Entry) != 0).Reverse());

            while (q.Count > 0)
            {
                var block = q.Pop();
                if (done.Contains(block))
                {
                    continue;
                }
                done.Add(block);

                foreach (var succ in block.Targets)
                {
                    q.Push(succ);
                }

                if (blockReferences.ContainsKey(block.Id))
                {
                    continue;
                }
                InsertEmptyStateUpdate(cfgCtx, block);
            }

            for (int i = 0; i < graph.Count; i++)
            {
                var block = graph[i];
                if (done.Contains(block) || blockReferences.ContainsKey(block.Id))
                {
                    continue;
                }
                InsertEmptyStateUpdate(cfgCtx, block);
            }

            // Update references
            foreach (var blockRef in blockReferences)
            {
                var      key = sequence[blockRef.Key];
                CFGState currentState;
                if (!cfgCtx.StatesMap.TryGetValue(key.EntryState, out currentState))
                {
                    Debug.Assert((graph[blockRef.Key].Type & ControlFlowBlockType.Entry) != 0);
                    Debug.Assert(key.Type == BlockKeyType.Explicit);

                    // Create new entry state
                    uint blockSeed = ctx.Random.NextUInt32();
                    currentState = new CFGState(blockSeed);
                    cfgCtx.StatesMap[key.EntryState] = currentState;

                    var         index = graph.Body.Instructions.IndexOf(graph[blockRef.Key].Header);
                    Instruction newHeader;
                    method.Body.Instructions.Insert(index++, newHeader = Instruction.Create(OpCodes.Ldloca, cfgCtx.StateVariable));
                    method.Body.Instructions.Insert(index++, Instruction.Create(OpCodes.Ldc_I4, (int)blockSeed));
                    method.Body.Instructions.Insert(index++, Instruction.Create(OpCodes.Call, ctx.CfgCtxCtor));
                    method.Body.ReplaceReference(graph[blockRef.Key].Header, newHeader);
                    key.Type = BlockKeyType.Incremental;
                }
                var type = key.Type;

                for (int i = 0; i < blockRef.Value.Count; i++)
                {
                    var refEntry = blockRef.Value.Values[i];

                    CFGState?targetState = null;
                    if (i == blockRef.Value.Count - 1)
                    {
                        CFGState exitState;
                        if (cfgCtx.StatesMap.TryGetValue(key.ExitState, out exitState))
                        {
                            targetState = exitState;
                        }
                    }

                    var index = graph.Body.Instructions.IndexOf(refEntry.Item1) + 1;
                    var value = InsertStateGetAndUpdate(cfgCtx, ref index, type, ref currentState, targetState);

                    refEntry.Item1.OpCode  = OpCodes.Ldc_I4;
                    refEntry.Item1.Operand = (int)(refEntry.Item2 ^ value);
                    method.Body.Instructions.Insert(index++, Instruction.Create(OpCodes.Xor));
                    method.Body.Instructions.Insert(index, Instruction.Create(OpCodes.Call, refEntry.Item3));

                    if (i == blockRef.Value.Count - 1 && targetState == null)
                    {
                        cfgCtx.StatesMap[key.ExitState] = currentState;
                    }

                    type = BlockKeyType.Incremental;
                }
            }
        }
Пример #3
0
        public override void Reset()
        {
            base.Reset();
            Layers = new System.Collections.ObjectModel.ObservableCollection <Layer>()
            {
                new Layer("Dota 2 Respawn", new Layers.Dota2RespawnLayerHandler()),
                new Layer("Health Indicator", new PercentLayerHandler()
                {
                    Properties = new PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(0, 255, 0),
                        _SecondaryColor = Color.FromArgb(0, 60, 0),
                        _PercentType    = PercentEffectType.Progressive_Gradual,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4,
                            Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8,
                            Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12
                        }),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "Hero/Health",
                        _MaxVariablePath = "Hero/MaxHealth"
                    },
                })
                {
                    Logics = new System.Collections.ObjectModel.ObservableCollection <LogicItem>()
                    {
                    }
                },
                new Layer("Mana Indicator", new PercentLayerHandler()
                {
                    Properties = new PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(0, 125, 255),
                        _SecondaryColor = Color.FromArgb(0, 0, 60),
                        _PercentType    = PercentEffectType.Progressive_Gradual,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR,
                            Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT,
                            Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS
                        }),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "Hero/Mana",
                        _MaxVariablePath = "Hero/MaxMana"
                    },
                })
                {
                    Logics = new System.Collections.ObjectModel.ObservableCollection <LogicItem>()
                    {
                    }
                },
                new Layer("Dota 2 Ability Keys", new Layers.Dota2AbilityLayerHandler()),
                new Layer("Dota 2 Item Keys", new Layers.Dota2ItemLayerHandler()),
                new Layer("Dota 2 Hero Ability Effects", new Layers.Dota2HeroAbilityEffectsLayerHandler()),
                new Layer("Dota 2 Killstreaks", new Layers.Dota2KillstreakLayerHandler()),
                new Layer("Dota 2 Background", new Layers.Dota2BackgroundLayerHandler())
            };

            //Effects
            //// Background
            bg_team_enabled        = true;
            radiant_color          = Color.FromArgb(0, 140, 30);
            dire_color             = Color.FromArgb(200, 0, 0);
            ambient_color          = Color.FromArgb(140, 190, 230);
            bg_enable_dimming      = true;
            bg_dim_after           = 15; //seconds
            bg_respawn_glow        = true;
            bg_respawn_glow_color  = Color.FromArgb(255, 255, 255);
            bg_display_killstreaks = true;
            bg_killstreaks_lines   = true;
            bg_killstreakcolors    = new List <Color>()
            {
                Color.FromArgb(0, 0, 0),                             //No Streak
                Color.FromArgb(0, 0, 0),                             //First kill
                Color.FromArgb(255, 255, 255),                       //Double Kill
                Color.FromArgb(0, 255, 0),                           //Killing Spree
                Color.FromArgb(128, 0, 255),                         //Dominating
                Color.FromArgb(255, 100, 100),                       //Mega Kill
                Color.FromArgb(255, 80, 0),                          //Unstoppable
                Color.FromArgb(130, 180, 130),                       //Wicked Sick
                Color.FromArgb(255, 0, 255),                         //Monster Kill
                Color.FromArgb(255, 0, 0),                           //Godlike
                Color.FromArgb(255, 80, 0)                           //Godlike+
            };
            bg_peripheral_use = true;


            //// Health
            health_enabled         = true;
            healthy_color          = Color.FromArgb(0, 255, 0);
            hurt_color             = Color.FromArgb(0, 60, 0);
            health_effect_type     = PercentEffectType.Progressive_Gradual;
            health_sequence        = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4, Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8, Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12 });
            health_blink_threshold = 0.0D;

            //// Mana
            mana_enabled         = true;
            mana_color           = Color.FromArgb(0, 125, 255);
            nomana_color         = Color.FromArgb(0, 0, 60);
            mana_effect_type     = PercentEffectType.Progressive_Gradual;
            mana_sequence        = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR, Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT, Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS });
            mana_blink_threshold = 0.0D;

            mimic_respawn_timer                  = true;
            mimic_respawn_timer_color            = Color.FromArgb(255, 0, 0);
            mimic_respawn_timer_respawning_color = Color.FromArgb(255, 170, 0);

            //// Abilities
            abilitykeys_enabled       = true;
            ability_can_use_color     = Color.FromArgb(0, 255, 0);
            ability_can_not_use_color = Color.FromArgb(255, 0, 0);
            ability_keys = new List <Devices.DeviceKeys>()
            {
                Devices.DeviceKeys.Q, Devices.DeviceKeys.W, Devices.DeviceKeys.E, Devices.DeviceKeys.D, Devices.DeviceKeys.F, Devices.DeviceKeys.R
            };

            //// Items
            items_enabled           = true;
            items_empty_color       = Color.FromArgb(0, 0, 0);
            items_on_cooldown_color = Color.FromArgb(0, 0, 0);
            items_no_charges_color  = Color.FromArgb(150, 150, 150);
            items_color             = Color.FromArgb(255, 255, 255);
            items_use_item_color    = true;
            items_keys = new List <Devices.DeviceKeys>()
            {
                Devices.DeviceKeys.Z, Devices.DeviceKeys.X, Devices.DeviceKeys.C, Devices.DeviceKeys.V, Devices.DeviceKeys.B, Devices.DeviceKeys.N, Devices.DeviceKeys.INSERT, Devices.DeviceKeys.HOME, Devices.DeviceKeys.PAGE_UP, Devices.DeviceKeys.DELETE, Devices.DeviceKeys.END, Devices.DeviceKeys.PAGE_DOWN
            };

            // Lighting Areas
            lighting_areas = new List <ColorZone>();
        }
Пример #4
0
 private void Awake()
 {
     instruments = level.GetComponentsInChildren <Instrument>();
     keySequence = Instantiate(keySequence);
 }
Пример #5
0
        private static void ReplaceCFG(MethodDef method, List <Tuple <Instruction, uint, IMethod> > instrs, CEContext ctx)
        {
            if (method.Name == "GetCpuName")
            {
                Debugger.Break();
            }
            var graph    = ControlFlowGraph.Construct(method.Body);
            var sequence = KeySequence.ComputeKeys(graph, ctx.Random);

            var cfgCtx = new CFGContext {
                Graph  = graph,
                Keys   = sequence,
                Random = ctx.Random
            };
            var blockReferences = new Dictionary <int, SortedList <int, Tuple <Instruction, uint, IMethod> > >();

            foreach (var instr in instrs)
            {
                var index = graph.IndexOf(instr.Item1);
                var block = graph.GetContainingBlock(index);

                SortedList <int, Tuple <Instruction, uint, IMethod> > list;
                if (!blockReferences.TryGetValue(block.Id, out list))
                {
                    list = blockReferences[block.Id] = new SortedList <int, Tuple <Instruction, uint, IMethod> >();
                }

                list.Add(index, instr);
            }

            cfgCtx.StateVariable = new Local(method.Module.CorLibTypes.UInt32);
            method.Body.Variables.Add(cfgCtx.StateVariable);
            method.Body.InitLocals = true;

            // Update state for blocks not in use
            for (int i = 0; i < graph.Count; i++)
            {
                if (blockReferences.ContainsKey(i))
                {
                    continue;
                }
                InsertEmptyStateUpdate(cfgCtx, graph[i]);
            }

            // Update references
            foreach (var blockRef in blockReferences)
            {
                var key          = sequence[blockRef.Key];
                var currentState = key.EntryState;
                var type         = key.Type;

                for (int i = 0; i < blockRef.Value.Count; i++)
                {
                    var entry       = blockRef.Value.Values[i];
                    var targetState = i == blockRef.Value.Count - 1 ? key.ExitState : cfgCtx.Random.NextUInt32();
                    var index       = graph.Body.Instructions.IndexOf(entry.Item1);
                    var id          = entry.Item2 ^ currentState;

                    entry.Item1.OpCode  = OpCodes.Ldc_I4;
                    entry.Item1.Operand = (int)id;
                    index = InsertStateGetAndUpdate(cfgCtx, index + 1, type, currentState, targetState);
                    method.Body.Instructions.Insert(index + 0, Instruction.Create(OpCodes.Xor));
                    method.Body.Instructions.Insert(index + 1, Instruction.Create(OpCodes.Call, entry.Item3));

                    type         = BlockKeyType.Incremental;
                    currentState = targetState;
                }
            }
        }
Пример #6
0
        private static void LoadSequenceString(string line)
        {
            // Only bother with sequences that start with <Multi_key>
            var m1 = Regex.Match(line, @"^\s*<Multi_key>\s*([^:]*):[^""]*""(([^""]|\\"")*)""[^#]*#?\s*(.*)");
            //                                             ^^^^^^^         ^^^^^^^^^^^^^^^            ^^^^
            //                                              keys               result                 desc
            if (m1.Groups.Count < 4)
                return;

            var keysyms = Regex.Split(m1.Groups[1].Captures[0].ToString(), @"[\s<>]+");

            if (keysyms.Length < 4) // We need 2 empty strings + at least 2 keysyms
                return;

            KeySequence seq = new KeySequence();

            for (int i = 1; i < keysyms.Length; ++i)
            {
                if (keysyms[i] == String.Empty)
                    continue;

                Key k = Key.FromKeySym(keysyms[i]);
                if (k == null)
                {
                    //Console.WriteLine("Unknown key name <{0}>, ignoring sequence", keysyms[i]);
                    return; // Unknown key name! Better bail out
                }

                seq.Add(k);
            }

            string result = m1.Groups[2].Captures[0].ToString();
            string description = m1.Groups.Count >= 5 ? m1.Groups[4].Captures[0].ToString() : "";

            // Replace \\ and \" in the string output
            result = new Regex(@"\\(\\|"")").Replace(result, "$1");

            // Try to translate the description if appropriate
            int utf32 = StringToCodepoint(result);
            if (utf32 >= 0)
            {
                string key = String.Format("U{0:X04}", utf32);
                string alt_desc = unicode.Char.ResourceManager.GetString(key);
                if (alt_desc != null && alt_desc.Length > 0)
                    description = alt_desc;
            }

            m_sequences.Add(seq, result, utf32, description);
            ++m_sequence_count;
        }
Пример #7
0
 public static bool IsValidSequence(KeySequence sequence, bool ignore_case)
 {
     return m_sequences.IsValidSequence(sequence, ignore_case);
 }
Пример #8
0
 static void TestSequencePressed(KeySequence sec)
 {
     GameObject heroe = GameObject.FindGameObjectWithTag("Player2");
     heroe.GetComponentInChildren<Spawnerizq>().shoot();
 }
Пример #9
0
    // Update is called once per frame
    void Update()
    {
        float time = Time.deltaTime;

        repeatKeyString  = "";
        pressedKeyString = "";
        for (int i = 0; i < pressedKeys.Count; ++i)
        {
            KeyEvent keyEvent = pressedKeys[i];
            pressedKeyString += KeyManager.KeyCodeToString(keyEvent.keyLocation.keyCode);
            if (Input.GetKey(keyEvent.keyLocation.keyCode))
            {
                keyEvent.lifetime -= time;
                GameManager.instance.boat.health.TakeDamage(-time / HEALING_SCALE);
                AudioManager.instance.PlaySound("Healing");
            }
            else
            {
                keyEvent.timeout -= time;
                GameManager.instance.boat.health.TakeDamage(time);
                if (keyEvent.timeout <= 0)
                {
                    GameManager.instance.boat.health.TakeDamage(TIMEOUT_DAMAGE);
                    AudioManager.instance.PlaySound("Damage1");
                }
            }
            if (keyEvent.lifetime <= 0 || keyEvent.timeout <= 0)
            {
                // remove from KeyManager
                KeyManager.instance.RemoveKey(keyEvent.keyLocation.keyCode);
            }
        }
        for (int i = 0; i < repeatKeys.Count; ++i)
        {
            KeyEvent keyEvent = repeatKeys[i];
            repeatKeyString += KeyManager.KeyCodeToString(keyEvent.keyLocation.keyCode);
            if (Input.GetKeyDown(keyEvent.keyLocation.keyCode))
            {
                keyEvent.lifetime -= 1;
                GameManager.instance.boat.health.TakeDamage(1f / HEALING_SCALE);
                AudioManager.instance.PlaySound("Nailing");
            }
            else
            {
                keyEvent.timeout -= time;
                GameManager.instance.boat.health.TakeDamage(time);
                if (keyEvent.timeout <= 0)
                {
                    GameManager.instance.boat.health.TakeDamage(TIMEOUT_DAMAGE);
                    AudioManager.instance.PlaySound("Damage1");
                }
            }
            if (keyEvent.lifetime <= 0 || keyEvent.timeout <= 0)
            {
                // remove from KeyManager
                KeyManager.instance.RemoveKey(keyEvent.keyLocation.keyCode);
            }
        }
        for (int i = 0; i < keySequences.Count; ++i)
        {
            KeySequence keySequence = keySequences[i];
            KeyEvent    keyEvent    = keySequence.keyEvents[keySequence.currentIndex];
            if (Input.GetKeyDown(keyEvent.keyLocation.keyCode))
            {
                keySequence.currentIndex++;
            }
            else
            {
                keyEvent.timeout -= time;
                GameManager.instance.boat.health.TakeDamage(time);
                if (keyEvent.timeout <= 0)
                {
                    GameManager.instance.boat.health.TakeDamage(TIMEOUT_DAMAGE);
                    AudioManager.instance.PlaySound("Damage1");
                }
            }
            if (keySequence.currentIndex == keySequence.keyEvents.Count || keyEvent.timeout <= 0)
            {
                // remove from KeyManager
                KeyManager.instance.RemoveKey(keyEvent.keyLocation.keyCode);
            }
        }
        // remove all dead key events
        pressedKeys.RemoveAll(keyEvent => keyEvent.lifetime <= 0 || keyEvent.timeout <= 0);
        repeatKeys.RemoveAll(keyEvent => keyEvent.lifetime <= 0 || keyEvent.timeout <= 0);
        keySequences.RemoveAll(keySequence => keySequence.currentIndex == keySequence.keyEvents.Count || keySequence.keyEvents[keySequence.currentIndex].timeout <= 0);
    }
Пример #10
0
        public DesktopSettings()
        {
            isEnabled = true;

            Layers = new System.Collections.ObjectModel.ObservableCollection <Settings.Layers.Layer>()
            {
                new Settings.Layers.Layer("Shortcut Assistant", new Settings.Layers.ShortcutAssistantLayerHandler()
                {
                    Properties = new Settings.Layers.ShortcutAssistantLayerHandlerProperties()
                }),
                new Settings.Layers.Layer("CPU Usage", new Settings.Layers.PercentLayerHandler()
                {
                    Properties = new Settings.Layers.PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(0, 205, 255),
                        _SecondaryColor = Color.FromArgb(0, 65, 80),
                        _PercentType    = PercentEffectType.Progressive_Gradual,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4,
                            Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8,
                            Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12
                        }),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "LocalPCInfo/CPUUsage",
                        _MaxVariablePath = "100"
                    },
                }),
                new Settings.Layers.Layer("RAM Usage", new Settings.Layers.PercentLayerHandler()
                {
                    Properties = new Settings.Layers.PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(255, 80, 0),
                        _SecondaryColor = Color.FromArgb(90, 30, 0),
                        _PercentType    = PercentEffectType.Progressive_Gradual,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR,
                            Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT,
                            Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS
                        }),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "LocalPCInfo/MemoryUsed",
                        _MaxVariablePath = "LocalPCInfo/MemoryTotal"
                    },
                }),
                new Settings.Layers.Layer("Interactive Layer", new Settings.Layers.InteractiveLayerHandler()
                {
                    Properties = new Settings.Layers.InteractiveLayerHandlerProperties()
                    {
                        _InteractiveEffect    = InteractiveEffects.Wave_Filled,
                        _PrimaryColor         = Color.FromArgb(0, 255, 0),
                        _RandomPrimaryColor   = true,
                        _SecondaryColor       = Color.FromArgb(255, 0, 0),
                        _RandomSecondaryColor = true,
                        _EffectSpeed          = 5.0f,
                        _EffectWidth          = 2,
                        _TriggerOnMouseClick  = false
                    }
                }
                                          )
            };

            //Effects
            //// CPU
            cpu_usage_enabled          = true;
            cpu_used_color             = Color.FromArgb(0, 205, 255);
            cpu_free_color             = Color.FromArgb(0, 65, 80);
            cpu_free_color_transparent = false;
            cpu_usage_effect_type      = PercentEffectType.Progressive_Gradual;
            cpu_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4,
                Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8,
                Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12
            });

            //// Ram
            ram_usage_enabled          = true;
            ram_used_color             = Color.FromArgb(255, 80, 0);
            ram_free_color             = Color.FromArgb(90, 30, 0);
            ram_free_color_transparent = false;
            ram_usage_effect_type      = PercentEffectType.Progressive_Gradual;
            ram_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR,
                Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT,
                Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS
            });

            //// Shortcuts Assistant
            shortcuts_assistant_enabled = true;
            shortcuts_assistant_bim_bg  = false;
            ctrl_key_color    = Color.Red;
            ctrl_key_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.C, Devices.DeviceKeys.V, Devices.DeviceKeys.X, Devices.DeviceKeys.Y,
                Devices.DeviceKeys.LEFT_ALT, Devices.DeviceKeys.RIGHT_ALT, Devices.DeviceKeys.A, Devices.DeviceKeys.Z
            });
            win_key_color    = Color.Blue;
            win_key_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.R, Devices.DeviceKeys.E, Devices.DeviceKeys.M, Devices.DeviceKeys.D,
                Devices.DeviceKeys.ARROW_UP, Devices.DeviceKeys.ARROW_DOWN, Devices.DeviceKeys.ARROW_LEFT, Devices.DeviceKeys.ARROW_RIGHT,
                Devices.DeviceKeys.TAB
            });
            alt_key_color    = Color.Yellow;
            alt_key_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.F4, Devices.DeviceKeys.E, Devices.DeviceKeys.V, Devices.DeviceKeys.LEFT_CONTROL,
                Devices.DeviceKeys.RIGHT_CONTROL, Devices.DeviceKeys.TAB
            });

            //// Lighting Areas
            lighting_areas = new List <ColorZone>();

            //// Interactive Effects
            interactive_effects_enabled                = false;
            interactive_effect_type                    = InteractiveEffects.None;
            interactive_effect_primary_color           = Color.FromArgb(0, 255, 0);
            interactive_effects_random_primary_color   = false;
            interactive_effect_secondary_color         = Color.FromArgb(255, 0, 0);
            interactive_effects_random_secondary_color = false;
            interactive_effect_speed                   = 1.0f;
            interactive_effect_width                   = 2;
            interactive_effects_mouse_clicking         = false;
        }
Пример #11
0
        public TER_Settings()
        {
            //General
            isEnabled = true;

            Layers = new System.Collections.ObjectModel.ObservableCollection <Settings.Layers.Layer>
            {
                new Settings.Layers.Layer("Health Indicator", new Settings.Layers.PercentLayerHandler()
                {
                    Properties = new Settings.Layers.PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(0, 255, 0),
                        _SecondaryColor = Color.FromArgb(255, 0, 0),
                        _PercentType    = PercentEffectType.Progressive_Gradual,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.ESC, Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4, Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8, Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12, Devices.DeviceKeys.TILDE, Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR, Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT, Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS, Devices.DeviceKeys.BACKSPACE, Devices.DeviceKeys.TAB, Devices.DeviceKeys.Q, Devices.DeviceKeys.W, Devices.DeviceKeys.E, Devices.DeviceKeys.R, Devices.DeviceKeys.T, Devices.DeviceKeys.Y, Devices.DeviceKeys.U, Devices.DeviceKeys.I, Devices.DeviceKeys.O, Devices.DeviceKeys.P, Devices.DeviceKeys.OPEN_BRACKET, Devices.DeviceKeys.CLOSE_BRACKET, Devices.DeviceKeys.BACKSLASH, Devices.DeviceKeys.CAPS_LOCK, Devices.DeviceKeys.A, Devices.DeviceKeys.S, Devices.DeviceKeys.D, Devices.DeviceKeys.F, Devices.DeviceKeys.G, Devices.DeviceKeys.H, Devices.DeviceKeys.J, Devices.DeviceKeys.K, Devices.DeviceKeys.L, Devices.DeviceKeys.SEMICOLON, Devices.DeviceKeys.APOSTROPHE, Devices.DeviceKeys.ENTER, Devices.DeviceKeys.LEFT_SHIFT, Devices.DeviceKeys.Z, Devices.DeviceKeys.X, Devices.DeviceKeys.C, Devices.DeviceKeys.V, Devices.DeviceKeys.B, Devices.DeviceKeys.N, Devices.DeviceKeys.M, Devices.DeviceKeys.COMMA, Devices.DeviceKeys.PERIOD, Devices.DeviceKeys.FORWARD_SLASH, Devices.DeviceKeys.RIGHT_SHIFT, Devices.DeviceKeys.LEFT_CONTROL, Devices.DeviceKeys.LEFT_WINDOWS, Devices.DeviceKeys.LEFT_ALT, Devices.DeviceKeys.SPACE, Devices.DeviceKeys.RIGHT_ALT, Devices.DeviceKeys.RIGHT_WINDOWS, Devices.DeviceKeys.APPLICATION_SELECT, Devices.DeviceKeys.RIGHT_CONTROL, Devices.DeviceKeys.G1, Devices.DeviceKeys.G2, Devices.DeviceKeys.G3, Devices.DeviceKeys.G4, Devices.DeviceKeys.G5, Devices.DeviceKeys.G6, Devices.DeviceKeys.G7, Devices.DeviceKeys.G8, Devices.DeviceKeys.G9, Devices.DeviceKeys.G10, Devices.DeviceKeys.G11, Devices.DeviceKeys.G12, Devices.DeviceKeys.G13, Devices.DeviceKeys.G14, Devices.DeviceKeys.G15, Devices.DeviceKeys.G16, Devices.DeviceKeys.G17, Devices.DeviceKeys.G18, Devices.DeviceKeys.G19, Devices.DeviceKeys.G20, Devices.DeviceKeys.ADDITIONALLIGHT1, Devices.DeviceKeys.ADDITIONALLIGHT2, Devices.DeviceKeys.ADDITIONALLIGHT3, Devices.DeviceKeys.ADDITIONALLIGHT4, Devices.DeviceKeys.ADDITIONALLIGHT5, Devices.DeviceKeys.ADDITIONALLIGHT6, Devices.DeviceKeys.ADDITIONALLIGHT7, Devices.DeviceKeys.ADDITIONALLIGHT8, Devices.DeviceKeys.ADDITIONALLIGHT9, Devices.DeviceKeys.ADDITIONALLIGHT10
                        }),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "LocalPlayer/Health/Current",
                        _MaxVariablePath = "LocalPlayer/Health/Max"
                    },
                }),
                new Settings.Layers.Layer("Mana Indicator", new Settings.Layers.PercentLayerHandler()
                {
                    Properties = new Settings.Layers.PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(0, 255, 255),
                        _SecondaryColor = Color.FromArgb(255, 255, 255),
                        _PercentType    = PercentEffectType.Progressive_Gradual,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.PRINT_SCREEN, Devices.DeviceKeys.SCROLL_LOCK, Devices.DeviceKeys.PAUSE_BREAK, Devices.DeviceKeys.INSERT, Devices.DeviceKeys.HOME, Devices.DeviceKeys.PAGE_UP, Devices.DeviceKeys.DELETE, Devices.DeviceKeys.END, Devices.DeviceKeys.PAGE_DOWN, Devices.DeviceKeys.ARROW_UP, Devices.DeviceKeys.ARROW_LEFT, Devices.DeviceKeys.ARROW_DOWN, Devices.DeviceKeys.ARROW_RIGHT, Devices.DeviceKeys.BRIGHTNESS_SWITCH, Devices.DeviceKeys.LOCK_SWITCH, Devices.DeviceKeys.MEDIA_PLAY_PAUSE, Devices.DeviceKeys.MEDIA_PLAY, Devices.DeviceKeys.MEDIA_PAUSE, Devices.DeviceKeys.MEDIA_STOP, Devices.DeviceKeys.MEDIA_PREVIOUS, Devices.DeviceKeys.MEDIA_NEXT, Devices.DeviceKeys.VOLUME_MUTE, Devices.DeviceKeys.VOLUME_UP, Devices.DeviceKeys.NUM_LOCK, Devices.DeviceKeys.NUM_SLASH, Devices.DeviceKeys.NUM_ASTERISK, Devices.DeviceKeys.NUM_MINUS, Devices.DeviceKeys.NUM_SEVEN, Devices.DeviceKeys.NUM_EIGHT, Devices.DeviceKeys.NUM_NINE, Devices.DeviceKeys.NUM_PLUS, Devices.DeviceKeys.NUM_FOUR, Devices.DeviceKeys.NUM_FIVE, Devices.DeviceKeys.NUM_SIX, Devices.DeviceKeys.NUM_ONE, Devices.DeviceKeys.NUM_TWO, Devices.DeviceKeys.NUM_THREE, Devices.DeviceKeys.NUM_ENTER, Devices.DeviceKeys.NUM_ZERO, Devices.DeviceKeys.NUM_PERIOD
                        }),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "LocalPlayer/Mana/Current",
                        _MaxVariablePath = "LocalPlayer/Mana/Max"
                    },
                }),
                new Settings.Layers.Layer("Terraria Background", new Terraria.Layers.TERBackgroundLayerHandler())
            };

            //Effects
            //// Background
            bg_enabled = true;
            // assault_color = Color.FromArgb(158, 205, 255);
            // winters_color = Color.FromArgb(221, 99, 33);
            // assault_fade_color = Color.FromArgb(255, 255, 255);
            // assault_speed_mult = 1.0f;
            // assault_animation_enabled = true;
            ambient_color = Color.FromArgb(158, 205, 255);
            // low_suspicion_color = Color.FromArgb(0, 0, 0, 255);
            // medium_suspicion_color = Color.FromArgb(255, 0, 0, 255);
            // high_suspicion_color = Color.FromArgb(255, 255, 0, 0);
            // bg_show_suspicion = true;
            // suspicion_effect_type = PercentEffectType.Progressive;
            bg_peripheral_use = true;

            //// Health
            health_enabled = true;
            // gold_health_color = Color.FromArgb(255, 215, 0);
            health_color = Color.FromArgb(255, 0, 0);
            // hurt_color = Color.FromArgb(255, 0, 0);
            health_effect_type = PercentEffectType.Progressive_Gradual;
            //health_sequence = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4, Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8, Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12 });
            health_sequence = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.ESC, Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4, Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8, Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12, Devices.DeviceKeys.TILDE, Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR, Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT, Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS, Devices.DeviceKeys.BACKSPACE, Devices.DeviceKeys.TAB, Devices.DeviceKeys.Q, Devices.DeviceKeys.W, Devices.DeviceKeys.E, Devices.DeviceKeys.R, Devices.DeviceKeys.T, Devices.DeviceKeys.Y, Devices.DeviceKeys.U, Devices.DeviceKeys.I, Devices.DeviceKeys.O, Devices.DeviceKeys.P, Devices.DeviceKeys.OPEN_BRACKET, Devices.DeviceKeys.CLOSE_BRACKET, Devices.DeviceKeys.BACKSLASH, Devices.DeviceKeys.CAPS_LOCK, Devices.DeviceKeys.A, Devices.DeviceKeys.S, Devices.DeviceKeys.D, Devices.DeviceKeys.F, Devices.DeviceKeys.G, Devices.DeviceKeys.H, Devices.DeviceKeys.J, Devices.DeviceKeys.K, Devices.DeviceKeys.L, Devices.DeviceKeys.SEMICOLON, Devices.DeviceKeys.APOSTROPHE, Devices.DeviceKeys.ENTER, Devices.DeviceKeys.LEFT_SHIFT, Devices.DeviceKeys.Z, Devices.DeviceKeys.X, Devices.DeviceKeys.C, Devices.DeviceKeys.V, Devices.DeviceKeys.B, Devices.DeviceKeys.N, Devices.DeviceKeys.M, Devices.DeviceKeys.COMMA, Devices.DeviceKeys.PERIOD, Devices.DeviceKeys.FORWARD_SLASH, Devices.DeviceKeys.RIGHT_SHIFT, Devices.DeviceKeys.LEFT_CONTROL, Devices.DeviceKeys.LEFT_WINDOWS, Devices.DeviceKeys.LEFT_ALT, Devices.DeviceKeys.SPACE, Devices.DeviceKeys.RIGHT_ALT, Devices.DeviceKeys.RIGHT_WINDOWS, Devices.DeviceKeys.APPLICATION_SELECT, Devices.DeviceKeys.RIGHT_CONTROL, Devices.DeviceKeys.G1, Devices.DeviceKeys.G2, Devices.DeviceKeys.G3, Devices.DeviceKeys.G4, Devices.DeviceKeys.G5, Devices.DeviceKeys.G6, Devices.DeviceKeys.G7, Devices.DeviceKeys.G8, Devices.DeviceKeys.G9, Devices.DeviceKeys.G10, Devices.DeviceKeys.G11, Devices.DeviceKeys.G12, Devices.DeviceKeys.G13, Devices.DeviceKeys.G14, Devices.DeviceKeys.G15, Devices.DeviceKeys.G16, Devices.DeviceKeys.G17, Devices.DeviceKeys.G18, Devices.DeviceKeys.G19, Devices.DeviceKeys.G20, Devices.DeviceKeys.ADDITIONALLIGHT1, Devices.DeviceKeys.ADDITIONALLIGHT2, Devices.DeviceKeys.ADDITIONALLIGHT3, Devices.DeviceKeys.ADDITIONALLIGHT4, Devices.DeviceKeys.ADDITIONALLIGHT5, Devices.DeviceKeys.ADDITIONALLIGHT6, Devices.DeviceKeys.ADDITIONALLIGHT7, Devices.DeviceKeys.ADDITIONALLIGHT8, Devices.DeviceKeys.ADDITIONALLIGHT9, Devices.DeviceKeys.ADDITIONALLIGHT10 });

            //// Ammo
            mana_enabled = true;
            mana_color   = Color.FromArgb(255, 0, 255);
            // noammo_color = Color.FromArgb(255, 0, 0);
            mana_effect_type = PercentEffectType.Progressive_Gradual;
            //mana_sequence = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR, Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT, Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS });
            mana_sequence = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.PRINT_SCREEN, Devices.DeviceKeys.SCROLL_LOCK, Devices.DeviceKeys.PAUSE_BREAK, Devices.DeviceKeys.INSERT, Devices.DeviceKeys.HOME, Devices.DeviceKeys.PAGE_UP, Devices.DeviceKeys.DELETE, Devices.DeviceKeys.END, Devices.DeviceKeys.PAGE_DOWN, Devices.DeviceKeys.ARROW_UP, Devices.DeviceKeys.ARROW_LEFT, Devices.DeviceKeys.ARROW_DOWN, Devices.DeviceKeys.ARROW_RIGHT, Devices.DeviceKeys.BRIGHTNESS_SWITCH, Devices.DeviceKeys.LOCK_SWITCH, Devices.DeviceKeys.MEDIA_PLAY_PAUSE, Devices.DeviceKeys.MEDIA_PLAY, Devices.DeviceKeys.MEDIA_PAUSE, Devices.DeviceKeys.MEDIA_STOP, Devices.DeviceKeys.MEDIA_PREVIOUS, Devices.DeviceKeys.MEDIA_NEXT, Devices.DeviceKeys.VOLUME_MUTE, Devices.DeviceKeys.VOLUME_UP, Devices.DeviceKeys.NUM_LOCK, Devices.DeviceKeys.NUM_SLASH, Devices.DeviceKeys.NUM_ASTERISK, Devices.DeviceKeys.NUM_MINUS, Devices.DeviceKeys.NUM_SEVEN, Devices.DeviceKeys.NUM_EIGHT, Devices.DeviceKeys.NUM_NINE, Devices.DeviceKeys.NUM_PLUS, Devices.DeviceKeys.NUM_FOUR, Devices.DeviceKeys.NUM_FIVE, Devices.DeviceKeys.NUM_SIX, Devices.DeviceKeys.NUM_ONE, Devices.DeviceKeys.NUM_TWO, Devices.DeviceKeys.NUM_THREE, Devices.DeviceKeys.NUM_ENTER, Devices.DeviceKeys.NUM_ZERO, Devices.DeviceKeys.NUM_PERIOD });

            //// States
            // downed_color = Color.White;
            // arrested_color = Color.DarkRed;

            //// Swan Song
            // swansong_enabled = true;
            // swansong_color = Color.FromArgb(158, 205, 255);
            // swansong_speed_mult = 1.0f;

            //// Lighting Areas
            lighting_areas = new List <ColorZone>();
        }
Пример #12
0
 /// <summary>
 /// Removes a KeySequence from the list of key sequences that are being monitored.
 /// </summary>
 /// <param name="keySequence"></param>
 public void RemoveKeySequence(KeySequence keySequence)
 {
     keySequences.Remove(keySequence);
 }
Пример #13
0
 /// <summary>
 /// Adds a KeySequence to the list of key sequences that are being monitored.
 /// </summary>
 /// <param name="keySequence"></param>
 public void AddKeySequence(KeySequence keySequence)
 {
     keySequences.Add(keySequence);
 }
Пример #14
0
 void Start()
 {
     kseq = kseqObj.GetComponent<KeySequence>();
 }
Пример #15
0
        public CSGOSettings()
        {
            //General
            first_time_installed = false;
            isEnabled            = true;

            Layers = new System.Collections.ObjectModel.ObservableCollection <Settings.Layers.Layer>()
            {
                new Settings.Layers.Layer("CSGO Typing Indicator", new Layers.CSGOTypingIndicatorLayerHandler()),
                new Settings.Layers.Layer("CSGO Kills Indicator", new Layers.CSGOKillIndicatorLayerHandler()),
                new Settings.Layers.Layer("CSGO Flashbang Effect", new Layers.CSGOFlashbangLayerHandler()),
                new Settings.Layers.Layer("Health Indicator", new Settings.Layers.PercentLayerHandler()
                {
                    Properties = new Settings.Layers.PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(0, 255, 0),
                        _SecondaryColor = Color.FromArgb(255, 0, 0),
                        _PercentType    = PercentEffectType.Progressive_Gradual,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4,
                            Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8,
                            Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12
                        }),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "Player/State/Health",
                        _MaxVariablePath = "100"
                    },
                }),
                new Settings.Layers.Layer("Ammo Indicator", new Settings.Layers.PercentLayerHandler()
                {
                    Properties = new Settings.Layers.PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(0, 0, 255),
                        _SecondaryColor = Color.FromArgb(255, 0, 0),
                        _PercentType    = PercentEffectType.Progressive,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR,
                            Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT,
                            Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS
                        }),
                        _BlinkThreshold  = 0.15,
                        _BlinkDirection  = false,
                        _VariablePath    = "Player/Weapons/ActiveWeapon/AmmoClip",
                        _MaxVariablePath = "Player/Weapons/ActiveWeapon/AmmoClipMax"
                    },
                }),
                new Settings.Layers.Layer("CSGO Bomb Effect", new Layers.CSGOBombLayerHandler()),
                new Settings.Layers.Layer("CSGO Burning Effect", new Layers.CSGOBurningLayerHandler()),
                new Settings.Layers.Layer("CSGO Background", new Layers.CSGOBackgroundLayerHandler())
            };

            //Effects
            //// Background
            bg_team_enabled   = true;
            ct_color          = Color.FromArgb(158, 205, 255);
            t_color           = Color.FromArgb(221, 99, 33);
            ambient_color     = Color.FromArgb(158, 205, 255);
            bg_enable_dimming = true;
            bg_dim_after      = 15; //seconds
            bg_peripheral_use = true;

            //// Health
            health_enabled     = true;
            healthy_color      = Color.FromArgb(0, 255, 0);
            hurt_color         = Color.FromArgb(255, 0, 0);
            health_effect_type = PercentEffectType.Progressive_Gradual;
            health_sequence    = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4, Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8, Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12 });

            //// Ammo
            ammo_enabled     = true;
            ammo_color       = Color.FromArgb(0, 0, 255);
            noammo_color     = Color.FromArgb(255, 0, 0);
            ammo_effect_type = PercentEffectType.Progressive;
            ammo_sequence    = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR, Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT, Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS });

            //// Bomb
            bomb_enabled              = true;
            bomb_flash_color          = Color.FromArgb(255, 0, 0);
            bomb_primed_color         = Color.FromArgb(0, 255, 0);
            bomb_display_winner_color = true;
            bomb_gradual              = true;
            bomb_sequence             = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.NUM_LOCK, Devices.DeviceKeys.NUM_SLASH, Devices.DeviceKeys.NUM_ASTERISK, Devices.DeviceKeys.NUM_MINUS, Devices.DeviceKeys.NUM_SEVEN, Devices.DeviceKeys.NUM_EIGHT, Devices.DeviceKeys.NUM_NINE, Devices.DeviceKeys.NUM_PLUS, Devices.DeviceKeys.NUM_FOUR, Devices.DeviceKeys.NUM_FIVE, Devices.DeviceKeys.NUM_SIX, Devices.DeviceKeys.NUM_ONE, Devices.DeviceKeys.NUM_TWO, Devices.DeviceKeys.NUM_THREE, Devices.DeviceKeys.NUM_ZERO, Devices.DeviceKeys.NUM_PERIOD, Devices.DeviceKeys.NUM_ENTER });
            bomb_peripheral_use       = true;

            //// Kills Indicator
            kills_indicator      = true;
            kills_regular_color  = Color.FromArgb(0, 255, 0);
            kills_headshot_color = Color.FromArgb(255, 80, 0);
            kills_sequence       = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.G1, Devices.DeviceKeys.G2, Devices.DeviceKeys.G3, Devices.DeviceKeys.G4, Devices.DeviceKeys.G5 });

            //// Lighting Areas
            lighting_areas = new List <ColorZone>();

            //// Burning
            burning_enabled        = true;
            burning_color          = Color.FromArgb(255, 70, 0);
            burning_animation      = true;
            burning_peripheral_use = true;

            //// Flashbang
            flashbang_enabled        = true;
            flash_color              = Color.FromArgb(255, 255, 255);
            flashbang_peripheral_use = true;

            ////Typing Keys
            typing_enabled  = true;
            typing_color    = Color.FromArgb(0, 255, 0);
            typing_sequence = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.TILDE, Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR, Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT, Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS, Devices.DeviceKeys.BACKSPACE,
                                                                         Devices.DeviceKeys.TAB, Devices.DeviceKeys.Q, Devices.DeviceKeys.W, Devices.DeviceKeys.E, Devices.DeviceKeys.R, Devices.DeviceKeys.T, Devices.DeviceKeys.Y, Devices.DeviceKeys.U, Devices.DeviceKeys.I, Devices.DeviceKeys.O, Devices.DeviceKeys.P, Devices.DeviceKeys.CLOSE_BRACKET, Devices.DeviceKeys.OPEN_BRACKET, Devices.DeviceKeys.BACKSLASH,
                                                                         Devices.DeviceKeys.CAPS_LOCK, Devices.DeviceKeys.A, Devices.DeviceKeys.S, Devices.DeviceKeys.D, Devices.DeviceKeys.F, Devices.DeviceKeys.G, Devices.DeviceKeys.H, Devices.DeviceKeys.J, Devices.DeviceKeys.K, Devices.DeviceKeys.L, Devices.DeviceKeys.SEMICOLON, Devices.DeviceKeys.APOSTROPHE, Devices.DeviceKeys.HASHTAG, Devices.DeviceKeys.ENTER,
                                                                         Devices.DeviceKeys.LEFT_SHIFT, Devices.DeviceKeys.BACKSLASH_UK, Devices.DeviceKeys.Z, Devices.DeviceKeys.X, Devices.DeviceKeys.C, Devices.DeviceKeys.V, Devices.DeviceKeys.B, Devices.DeviceKeys.N, Devices.DeviceKeys.M, Devices.DeviceKeys.COMMA, Devices.DeviceKeys.PERIOD, Devices.DeviceKeys.FORWARD_SLASH, Devices.DeviceKeys.RIGHT_SHIFT,
                                                                         Devices.DeviceKeys.LEFT_CONTROL, Devices.DeviceKeys.LEFT_WINDOWS, Devices.DeviceKeys.LEFT_ALT, Devices.DeviceKeys.SPACE, Devices.DeviceKeys.RIGHT_ALT, Devices.DeviceKeys.RIGHT_WINDOWS, Devices.DeviceKeys.APPLICATION_SELECT, Devices.DeviceKeys.RIGHT_CONTROL,
                                                                         Devices.DeviceKeys.ARROW_UP, Devices.DeviceKeys.ARROW_LEFT, Devices.DeviceKeys.ARROW_DOWN, Devices.DeviceKeys.ARROW_RIGHT, Devices.DeviceKeys.ESC });
        }
Пример #16
0
        public RocketLeagueSettings()
        {
            //Genereal
            isEnabled = true;

            Layers = new System.Collections.ObjectModel.ObservableCollection <Settings.Layers.Layer>()
            {
                new Settings.Layers.Layer("Boost Indicator", new Settings.Layers.PercentGradientLayerHandler()
                {
                    Properties = new Settings.Layers.PercentGradientLayerHandlerProperties()
                    {
                        _PercentType = PercentEffectType.Progressive_Gradual,
                        _Sequence    = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4, Devices.DeviceKeys.F5,
                            Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8, Devices.DeviceKeys.F9, Devices.DeviceKeys.F10,
                            Devices.DeviceKeys.F11, Devices.DeviceKeys.F12
                        }),
                        _Gradient        = new EffectsEngine.EffectBrush(new ColorSpectrum(Color.Yellow, Color.Red).SetColorAt(0.75f, Color.OrangeRed)),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "Player/BoostAmount",
                        _MaxVariablePath = "1.0",
                    },
                }),
                new Settings.Layers.Layer("Boost Indicator (Peripheral)", new Settings.Layers.PercentGradientLayerHandler()
                {
                    Properties = new Settings.Layers.PercentGradientLayerHandlerProperties()
                    {
                        _PercentType     = PercentEffectType.AllAtOnce,
                        _Sequence        = new KeySequence(new Devices.DeviceKeys[] { Devices.DeviceKeys.Peripheral }),
                        _Gradient        = new EffectsEngine.EffectBrush(new ColorSpectrum(Color.Yellow, Color.Red).SetColorAt(0.75f, Color.OrangeRed)),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "Player/BoostAmount",
                        _MaxVariablePath = "1.0"
                    },
                }),
                new Settings.Layers.Layer("Rocket League Background", new Layers.RocketLeagueBackgroundLayerHandler())
            };

            //Effects
            //// Background
            bg_enabled                  = true;
            bg_ambient_color            = Color.LightBlue;
            bg_use_team_color           = true;
            bg_user_defined_team_colors = false;
            bg_team_1 = Color.Orange;
            bg_team_2 = Color.Blue;
            bg_show_team_score_split = true;

            //// Boost
            boost_enabled  = true;
            boost_low      = Color.Yellow;
            boost_mid      = Color.OrangeRed;
            boost_high     = Color.Red;
            boost_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4, Devices.DeviceKeys.F5,
                Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8, Devices.DeviceKeys.F9, Devices.DeviceKeys.F10,
                Devices.DeviceKeys.F11, Devices.DeviceKeys.F12
            });
            boost_peripheral_use = true;

            //// Speed
            speed_enabled  = true;
            speed_low      = Color.Cyan;
            speed_mid      = Color.Purple;
            speed_high     = Color.Red;
            speed_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR, Devices.DeviceKeys.FIVE,
                Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT, Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO,
                Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS
            });
            speed_peripheral_use = false;


            //// Lighting Areas
            lighting_areas = new List <ColorZone>();
        }
Пример #17
0
 /// <summary>
 /// Add a successfully typed sequence to the stats
 /// </summary>
 /// <param name="sequence"></param>
 public static void AddSequence(KeySequence sequence)
 {
     int count = 0;
     m_sequence_stats.TryGetValue(sequence, out count);
     m_sequence_stats[sequence] = count + 1;
 }
Пример #18
0
 KeySequence UnicodeKeySequence(string keys)
 {
     var keySequence = new KeySequence();
     foreach (var ch in keys)
         keySequence.Add(Key.FromKeySym(Convert.ToString(ch)));
     return keySequence;
 }
Пример #19
0
        private static void LoadSequenceString(string line)
        {
            // If this is an include directive, use LoadSequenceFile() again
            var m0 = Regex.Match(line, @"^\s*include\s*""([^""]*)""");
            if (m0.Groups.Count > 1)
            {
                string file = m0.Groups[1].Captures[0].ToString();

                // We support %H (user directory) but not %L (locale-specific dir)
                if (file.Contains("%L"))
                    return;
                file = file.Replace("%H", GetUserDir());

                // Also if path is not absolute, prepend user directory
                if (!Path.IsPathRooted(file))
                    file = Path.Combine(GetUserDir(), file);

                LoadSequenceFile(file);
                return;
            }

            // Only bother with sequences that start with <Multi_key>
            var m1 = Regex.Match(line, @"^\s*<Multi_key>\s*([^:]*):[^""]*""(([^""]|\\"")*)""[^#]*#?\s*(.*)");
            //                                             ^^^^^^^         ^^^^^^^^^^^^^^^            ^^^^
            //                                              keys               result                 desc
            if (m1.Groups.Count < 4)
                return;

            var keysyms = Regex.Split(m1.Groups[1].Captures[0].ToString(), @"[\s<>]+");

            if (keysyms.Length < 4) // We need 2 empty strings + at least 2 keysyms
                return;

            KeySequence seq = new KeySequence();

            for (int i = 1; i < keysyms.Length; ++i)
            {
                if (keysyms[i] == String.Empty)
                    continue;

                Key k = Key.FromKeySym(keysyms[i]);
                if (k == null)
                {
                    //Console.WriteLine("Unknown key name <{0}>, ignoring sequence", keysyms[i]);
                    return; // Unknown key name! Better bail out
                }

                seq.Add(k);
            }

            string result = m1.Groups[2].Captures[0].ToString();
            string description = m1.Groups.Count >= 5 ? m1.Groups[4].Captures[0].ToString() : "";

            // Unescape \n \\ \" and more in the string output
            result = Regex.Replace(result, @"\\.", m =>
            {
                switch (m.Value)
                {
                    // These sequences are converted to their known value
                    case @"\n": return "\n";
                    case @"\r": return "\r";
                    case @"\t": return "\t";
                    // For all other sequences, just strip the leading \
                    default: return m.Value.Substring(1).ToString();
                }
            });

            // Try to translate the description if appropriate
            int utf32 = StringToCodepoint(result);
            if (utf32 >= 0)
            {
                string key = String.Format("U{0:X04}", utf32);
                string alt_desc = unicode.Char.ResourceManager.GetString(key);
                if (alt_desc != null && alt_desc.Length > 0)
                    description = alt_desc;
            }

            m_sequences.Add(seq, result, utf32, description);
            ++m_sequence_count;
        }
Пример #20
0
 public virtual void Default()
 {
     Logic         = (TProperty)Activator.CreateInstance(typeof(TProperty), new object[] { true });
     _PrimaryColor = Utils.ColorUtils.GenerateRandomColor();
     _Sequence     = new KeySequence();
 }
Пример #21
0
 public static string GetSequenceResult(KeySequence sequence, bool ignore_case)
 {
     return m_sequences.GetSequenceResult(sequence, ignore_case);
 }
Пример #22
0
        public override void Reset()
        {
            base.Reset();
            Layers = new System.Collections.ObjectModel.ObservableCollection <Layer>()
            {
                new Layer("Ctrl Shortcuts", new ShortcutAssistantLayerHandler()
                {
                    Properties = new ShortcutAssistantLayerHandlerProperties()
                    {
                        _PrimaryColor = Color.Red,
                        _ShortcutKeys = new Keybind[]
                        {
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.X }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.C }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.V }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.Z }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.F4 }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.A }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.D }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.R }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.Y }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.Right }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.Left }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.Down }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.Up }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.LMenu, Keys.Tab }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.LShiftKey, Keys.Up }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.LShiftKey, Keys.Down }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.LShiftKey, Keys.Left }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.LShiftKey, Keys.Right }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.Escape }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.LShiftKey, Keys.Escape }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.Escape }),
                            new Keybind(new Keys[] { Keys.LControlKey, Keys.F })
                        }
                    }
                }),
                new Layer("Win Shortcuts", new ShortcutAssistantLayerHandler()
                {
                    Properties = new ShortcutAssistantLayerHandlerProperties()
                    {
                        _PrimaryColor = Color.Blue,
                        _ShortcutKeys = new Keybind[]
                        {
                            new Keybind(new Keys[] { Keys.LWin, Keys.L }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.D }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.B }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.A }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.LMenu, Keys.D }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.E }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.G }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.I }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.M }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.P }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.R }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.S }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.Up }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.Down }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.Left }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.Right }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.Home }),
                            new Keybind(new Keys[] { Keys.LWin, Keys.D })
                        }
                    }
                }),
                new Layer("Alt Shortcuts", new ShortcutAssistantLayerHandler()
                {
                    Properties = new ShortcutAssistantLayerHandlerProperties()
                    {
                        _PrimaryColor = Color.Yellow,
                        _ShortcutKeys = new Keybind[]
                        {
                            new Keybind(new Keys[] { Keys.LMenu, Keys.Tab }),
                            new Keybind(new Keys[] { Keys.LMenu, Keys.F4 }),
                            new Keybind(new Keys[] { Keys.LMenu, Keys.Space }),
                            new Keybind(new Keys[] { Keys.LMenu, Keys.Left }),
                            new Keybind(new Keys[] { Keys.LMenu, Keys.Right }),
                            new Keybind(new Keys[] { Keys.LMenu, Keys.PageUp }),
                            new Keybind(new Keys[] { Keys.LMenu, Keys.PageDown }),
                            new Keybind(new Keys[] { Keys.LMenu, Keys.Tab }),
                        }
                    }
                }),
                new Layer("CPU Usage", new PercentLayerHandler()
                {
                    Properties = new PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(0, 205, 255),
                        _SecondaryColor = Color.FromArgb(0, 65, 80),
                        _PercentType    = PercentEffectType.Progressive_Gradual,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4,
                            Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8,
                            Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12
                        }),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "LocalPCInfo/CPUUsage",
                        _MaxVariablePath = "100"
                    },
                }),
                new Layer("RAM Usage", new PercentLayerHandler()
                {
                    Properties = new PercentLayerHandlerProperties()
                    {
                        _PrimaryColor   = Color.FromArgb(255, 80, 0),
                        _SecondaryColor = Color.FromArgb(90, 30, 0),
                        _PercentType    = PercentEffectType.Progressive_Gradual,
                        _Sequence       = new KeySequence(new Devices.DeviceKeys[] {
                            Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR,
                            Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT,
                            Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS
                        }),
                        _BlinkThreshold  = 0.0,
                        _BlinkDirection  = false,
                        _VariablePath    = "LocalPCInfo/MemoryUsed",
                        _MaxVariablePath = "LocalPCInfo/MemoryTotal"
                    },
                }),
                new Layer("Interactive Layer", new InteractiveLayerHandler()
                {
                    Properties = new InteractiveLayerHandlerProperties()
                    {
                        _InteractiveEffect    = InteractiveEffects.Wave_Filled,
                        _PrimaryColor         = Color.FromArgb(0, 255, 0),
                        _RandomPrimaryColor   = true,
                        _SecondaryColor       = Color.FromArgb(255, 0, 0),
                        _RandomSecondaryColor = true,
                        _EffectSpeed          = 5.0f,
                        _EffectWidth          = 2
                    }
                }
                          )
            };

            //Effects
            //// CPU
            cpu_usage_enabled          = true;
            cpu_used_color             = Color.FromArgb(0, 205, 255);
            cpu_free_color             = Color.FromArgb(0, 65, 80);
            cpu_free_color_transparent = false;
            cpu_usage_effect_type      = PercentEffectType.Progressive_Gradual;
            cpu_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.F1, Devices.DeviceKeys.F2, Devices.DeviceKeys.F3, Devices.DeviceKeys.F4,
                Devices.DeviceKeys.F5, Devices.DeviceKeys.F6, Devices.DeviceKeys.F7, Devices.DeviceKeys.F8,
                Devices.DeviceKeys.F9, Devices.DeviceKeys.F10, Devices.DeviceKeys.F11, Devices.DeviceKeys.F12
            });

            //// Ram
            ram_usage_enabled          = true;
            ram_used_color             = Color.FromArgb(255, 80, 0);
            ram_free_color             = Color.FromArgb(90, 30, 0);
            ram_free_color_transparent = false;
            ram_usage_effect_type      = PercentEffectType.Progressive_Gradual;
            ram_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.ONE, Devices.DeviceKeys.TWO, Devices.DeviceKeys.THREE, Devices.DeviceKeys.FOUR,
                Devices.DeviceKeys.FIVE, Devices.DeviceKeys.SIX, Devices.DeviceKeys.SEVEN, Devices.DeviceKeys.EIGHT,
                Devices.DeviceKeys.NINE, Devices.DeviceKeys.ZERO, Devices.DeviceKeys.MINUS, Devices.DeviceKeys.EQUALS
            });

            //// Shortcuts Assistant
            shortcuts_assistant_enabled = true;
            shortcuts_assistant_bim_bg  = false;
            ctrl_key_color    = Color.Red;
            ctrl_key_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.C, Devices.DeviceKeys.V, Devices.DeviceKeys.X, Devices.DeviceKeys.Y,
                Devices.DeviceKeys.LEFT_ALT, Devices.DeviceKeys.RIGHT_ALT, Devices.DeviceKeys.A, Devices.DeviceKeys.Z
            });
            win_key_color    = Color.Blue;
            win_key_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.R, Devices.DeviceKeys.E, Devices.DeviceKeys.M, Devices.DeviceKeys.D,
                Devices.DeviceKeys.ARROW_UP, Devices.DeviceKeys.ARROW_DOWN, Devices.DeviceKeys.ARROW_LEFT, Devices.DeviceKeys.ARROW_RIGHT,
                Devices.DeviceKeys.TAB
            });
            alt_key_color    = Color.Yellow;
            alt_key_sequence = new KeySequence(new Devices.DeviceKeys[] {
                Devices.DeviceKeys.F4, Devices.DeviceKeys.E, Devices.DeviceKeys.V, Devices.DeviceKeys.LEFT_CONTROL,
                Devices.DeviceKeys.RIGHT_CONTROL, Devices.DeviceKeys.TAB
            });

            //// Lighting Areas
            lighting_areas = new List <ColorZone>();

            //// Interactive Effects
            interactive_effects_enabled                = false;
            interactive_effect_type                    = InteractiveEffects.None;
            interactive_effect_primary_color           = Color.FromArgb(0, 255, 0);
            interactive_effects_random_primary_color   = false;
            interactive_effect_secondary_color         = Color.FromArgb(255, 0, 0);
            interactive_effects_random_secondary_color = false;
            interactive_effect_speed                   = 1.0f;
            interactive_effect_width                   = 2;
            interactive_effects_mouse_clicking         = false;
        }
Пример #23
0
    /// <summary>
    /// Add a key to the sequence currently being built. If necessary, output
    /// the finished sequence or trigger actions for invalid sequences.
    /// </summary>
    private static bool AddToSequence(Key key)
    {
        KeySequence old_sequence = new KeySequence(m_sequence);
        m_sequence.Add(key);

        // We try the following, in this order:
        //  1. if m_sequence + key is a valid prefix, it means the user
        //     could type other characters to build a longer sequence,
        //     so just append key to m_sequence.
        //  2. if m_sequence + key is a valid sequence, we can't go further,
        //     we append key to m_sequence and output the result.
        //  3. if m_sequence is a valid sequence, the user didn't type a
        //     valid key, so output the m_sequence result _and_ process key.
        //  4. (optionally) try again 1. 2. and 3. ignoring case.
        //  5. none of the characters make sense, output all of them as if
        //     the user didn't press Compose.
        foreach (bool ignore_case in Settings.CaseInsensitive.Value ?
                              new bool[]{ false, true } : new bool[]{ false })
        {
            if (Settings.IsValidPrefix(m_sequence, ignore_case))
            {
                // Still a valid prefix, continue building sequence
                return true;
            }

            if (Settings.IsValidSequence(m_sequence, ignore_case))
            {
                string tosend = Settings.GetSequenceResult(m_sequence,
                                                           ignore_case);
                Stats.AddSequence(m_sequence);
                Log.Debug("Valid sequence! Sending {0}", tosend);
                ResetSequence();
                SendString(tosend);
                return true;
            }

            // Some code duplication with the above block, but this way
            // what we are doing is more clear.
            if (Settings.IsValidSequence(old_sequence, ignore_case))
            {
                string tosend = Settings.GetSequenceResult(old_sequence,
                                                           ignore_case);
                Stats.AddSequence(old_sequence);
                Log.Debug("Sending previously valid sequence {0}", tosend);
                ResetSequence();
                SendString(tosend);
                return false;
            }
        }

        // Unknown characters for sequence, print them if necessary
        if (!Settings.DiscardOnInvalid.Value)
        {
            foreach (Key k in m_sequence)
            {
                // FIXME: what if the key is e.g. left arrow?
                if (k.IsPrintable())
                    SendString(k.ToString());
            }
        }

        if (Settings.BeepOnInvalid.Value)
            SystemSounds.Beep.Play();

        ResetSequence();
        return true;
    }
Пример #24
0
 public override void Default()
 {
     base.Default();
     _Sequence = new KeySequence(Effects.WholeCanvasFreeForm);
 }