Example #1
0
 public KeyboardDispatcher(GameWindow window)
 {
     _commandInputs = new List <char>();
     _keysDown      = new List <Keys>();
     _charsEntered  = new List <char>();
     _window        = window;
     if (Game1.game1.IsMainInstance)
     {
         KeyboardInput.Initialize(window);
     }
     KeyboardInput.CharEntered += EventInput_CharEntered;
     KeyboardInput.KeyDown     += EventInput_KeyDown;
 }
Example #2
0
        public void ctor(GameWindow window)
        {
            _commandInputs = new List <char>();
            _keysDown      = new List <Keys>();
            _charsEntered  = new List <char>();
            _window        = window;

            new DynData <KeyboardDispatcher>(this).Set("pastedResult", "");

            // https://stackoverflow.com/questions/1121441/addeventhandler-using-reflection
            // https://stackoverflow.com/questions/11120401/creating-delegate-from-methodinfo
            EventInfo windowTextInput = typeof(GameWindow).GetEvent("TextInput", all);
            Delegate  handler         = Delegate.CreateDelegate(windowTextInput.EventHandlerType, this, "Event_TextInput");

            windowTextInput.AddEventHandler(window, handler);

            KeyboardInput.Initialize(window);
        }
Example #3
0
 // Token: 0x0600011E RID: 286 RVA: 0x0000C545 File Offset: 0x0000A745
 public KeyboardDispatcher(GameWindow window)
 {
     KeyboardInput.Initialize(window);
     KeyboardInput.CharEntered += new CharEnteredHandler(this.EventInput_CharEntered);
     KeyboardInput.KeyDown     += new KeyEventHandler(this.EventInput_KeyDown);
 }
 public KeyboardDispatcher(GameWindow window)
 {
     KeyboardInput.Initialize(window);
     KeyboardInput.CharEntered += EventInput_CharEntered;
     KeyboardInput.KeyDown     += EventInput_KeyDown;
 }