예제 #1
0
 public static void StartCheckingToEndCtrlTab(Key Key)
 {
     if (CheckingToEndCtrlTab) return;
     KeyToEndOn = Key;
     IoHooks.KeyUp += CheckToEndCtrlTab;
     CheckingToEndCtrlTab = true;
 }
예제 #2
0
 public static void Chord(Key key)
 {
     CurrentChord1 = key;
     CurrentChord2 = Key.None;
 }
예제 #3
0
 public static void Chord(Key key1, Key key2)
 {
     CurrentChord1 = key1;
     CurrentChord2 = key2;
 }
예제 #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;
        }
예제 #5
0
 public bool MapsKey(Key key)
 {
     return true;
 }
예제 #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())
 {
 }