Example #1
0
 public static void WaitForInput()
 {
     TCODKey rawKey = TCODConsole.waitForKeypress(true);
     Key key = new Key(rawKey);
     if (events.Keys.Contains(key))
     {
         foreach (Action a in events[key])
             a();
     }
 }
Example #2
0
        public static void RegisterInputEvent(Key key, Action keyEvent)
        {
            List<Action> actions;
            if (!events.TryGetValue(key, out actions))
            {
                actions = new List<Action>();
                events[key] = actions;
            }

            events[key].Add(keyEvent);
        }
Example #3
0
 public static Key WaitForAndReturnInput()
 {
     TCODKey rawKey = TCODConsole.waitForKeypress(true);
     Key key = new Key(rawKey);
     return key;
 }
Example #4
0
 public static void RegisterInputEvent(Key[] keys, Action action)
 {
     foreach (Key k in keys)
         RegisterInputEvent(k, action);
 }