Пример #1
0
 public Input(NativeWindow window, BufferPool pool)
 {
     this.window             = window;
     this.window.KeyDown    += KeyDown;
     this.window.KeyUp      += KeyUp;
     this.window.MouseDown  += MouseDown;
     this.window.MouseUp    += MouseUp;
     this.window.MouseWheel += MouseWheel;
     this.window.KeyPress   += KeyPress;
     this.pool             = pool;
     anyDownedButtons      = new MouseButtonSet(8, pool);
     downedButtons         = new MouseButtonSet(8, pool);
     previousDownedButtons = new MouseButtonSet(8, pool);
     anyDownedKeys         = new KeySet(8, pool);
     downedKeys            = new KeySet(8, pool);
     previousDownedKeys    = new KeySet(8, pool);
     TypedCharacters       = new QuickList <char>(32, pool);
 }
Пример #2
0
        public Input(Window window)
        {
            this.window             = window.window;
            this.window.KeyDown    += KeyDown;
            this.window.KeyUp      += KeyUp;
            this.window.MouseDown  += MouseDown;
            this.window.MouseUp    += MouseUp;
            this.window.MouseWheel += MouseWheel;

            var keyPool         = new PassthroughArrayPool <Key>();
            var mouseButtonPool = new PassthroughArrayPool <MouseButton>();
            var intPool         = new PassthroughArrayPool <int>();

            MouseButtonSet.Create(mouseButtonPool, intPool, 3, 3, out anyDownedButtons);
            MouseButtonSet.Create(mouseButtonPool, intPool, 3, 3, out downedButtons);
            MouseButtonSet.Create(mouseButtonPool, intPool, 3, 3, out previousDownedButtons);
            KeySet.Create(keyPool, intPool, 3, 3, out anyDownedKeys);
            KeySet.Create(keyPool, intPool, 3, 3, out downedKeys);
            KeySet.Create(keyPool, intPool, 3, 3, out previousDownedKeys);
        }
Пример #3
0
        public Input(Window window)
        {
            this.window             = window.window;
            this.window.KeyDown    += KeyDown;
            this.window.KeyUp      += KeyUp;
            this.window.MouseDown  += MouseDown;
            this.window.MouseUp    += MouseUp;
            this.window.MouseWheel += MouseWheel;
            this.window.KeyPress   += KeyPress;
            var keyPool         = new PassthroughArrayPool <Key>();
            var mouseButtonPool = new PassthroughArrayPool <MouseButton>();
            var intPool         = new PassthroughArrayPool <int>();

            MouseButtonSet.Create(mouseButtonPool, intPool, 3, 3, out anyDownedButtons);
            MouseButtonSet.Create(mouseButtonPool, intPool, 3, 3, out downedButtons);
            MouseButtonSet.Create(mouseButtonPool, intPool, 3, 3, out previousDownedButtons);
            KeySet.Create(keyPool, intPool, 3, 3, out anyDownedKeys);
            KeySet.Create(keyPool, intPool, 3, 3, out downedKeys);
            KeySet.Create(keyPool, intPool, 3, 3, out previousDownedKeys);
            QuickList <char, Array <char> > .Create(new PassthroughArrayPool <char>(), 32, out TypedCharacters);
        }