public static void StartCheckingToEndCtrlTab(Key Key)
 {
     if (CheckingToEndCtrlTab) return;
     KeyToEndOn = Key;
     IoHooks.KeyUp += CheckToEndCtrlTab;
     CheckingToEndCtrlTab = true;
 }
Beispiel #2
0
 public static void Chord(Key key)
 {
     CurrentChord1 = key;
     CurrentChord2 = Key.None;
 }
Beispiel #3
0
 public static void Chord(Key key1, Key key2)
 {
     CurrentChord1 = key1;
     CurrentChord2 = key2;
 }
Beispiel #4
0
        public static void SetKeyMapping(Key k, SemanticAction A)
        {
            if (CurrentContext == null) return;

            if (!Map.ContainsKey(CurrentContext))
            {
                Map.Add(CurrentContext, new KeyMap());
            }
            var map = Map[CurrentContext];

            if (!map.ContainsKey(CurrentChord1))
            {
                map.Add(CurrentChord1, KeyMapOrAction.MakeEmptyMap());
            }
            map = map[CurrentChord1].MyMap;

            if (CurrentChord2 != Key.None)
            {
                if (!map.ContainsKey(CurrentChord2))
                {
                    map.Add(CurrentChord2, KeyMapOrAction.MakeEmptyMap());
                }

                map = map[CurrentChord2].MyMap;
            }

            if (!map.ContainsKey(k))
            {
                map.Add(k, new KeyMapOrAction());
            }

            map[k].MyAction = A;
        }
 public bool MapsKey(Key key)
 {
     return true;
 }
Beispiel #6
0
 public static Key ApplyShift(Key k)
 {
     return k.Value | ShiftMod.Value;
 }
        public SemanticAction(Key k, string Representation)
        {
            this.Representation = Representation;

            Action<Context, ExecuteType> action = (context, type) =>
            {
                if (type == ExecuteType.Press || type == ExecuteType.Down)
                {
                    if (Base.App.DoLog)
                    {
                        Base.App.Log(string.Format("  Press {0}", this.Representation));
                    }

                    k.DoDown();
                }

                if (type == ExecuteType.Press || type == ExecuteType.Up)
                {
                    if (Base.App.DoLog)
                    {
                        Base.App.Log(string.Format("  Release {0}", this.Representation));
                    }

                    k.DoUp();
                }
            };

            ContextualEvents.Add(Contexts.Default, action);
        }
 public SemanticAction(Key k)
     : this(k, k.ToString())
 {
 }