public static MEvent ButtonPressEvent(ConsoleKeyInfo keyInfo, MWidget sender) { MEventType t = MEventType.ButtonPress; List <int> p = new List <int>(); p.Add(IO.KeyAvailable.IndexOf(keyInfo.Key)); p.Add((int)keyInfo.Modifiers); return(new MEvent(t, p, sender)); }
public static MEvent ButtonPressEvent(ConsoleKey key, MWidget sender) { MEventType t = MEventType.ButtonPress; List <int> p = new List <int>(); // -1 wrong, // 0 = ESC, 1 = SPACE, 2 = <- 3 = ^ 4 = -> 5 = v p.Add(IO.KeyAvailable.IndexOf(key)); return(new MEvent(t, p, sender)); }
public MEvent(MEventType Type, List <int> Params, MWidget sender) { this.Type = Type; this.Params = Params; this.Sender = sender; listedParamsOnCreate = ""; for (int i = 0; i < Params.Count; ++i) { listedParamsOnCreate += Params[i] + ";"; } }
public void RepeatForChildren(MEventType typ, List <int> param) { ExecuteForAllChildren(ME(typ, param)); }
private MEvent ME(MEventType typ, List <int> param) { return(new MEvent(typ, param, this.Widget)); }
public void SetAction(MEventType type, EventAction action) { actions[(int)type] = action; }