Наследование: DisposableResource, IInput
Пример #1
0
        public Mouse(IDisposableResource parent)
            : base(parent)
        {
            input = parent.FindParentOrSelfWithException<Input>();
            input.UpdateEventCallback += UpdateEvent;
            input.UpdateCallback += Update;

            Left = new PositionButton();
            Middle = new PositionButton();
            Right = new PositionButton();
        }
Пример #2
0
        public Keyboard(IDisposableResource parent)
            : base(parent)
        {
            input = parent.FindParentOrSelfWithException<Input>();
            input.UpdateEventCallback += UpdateEvent;
            input.UpdateCallback += Update;

            keys = new bool[256];
            buttons = new Button[256];
            for (int i = 0; i != 256; ++i)
            {
                buttons[i] = new Button();
            }
        }