Exemple #1
0
        private static void HookInputEvents(ClientForm form, ClientFormInput input)
        {
            form.KeyUp += (object sender, KeyEventArgs e) => {
                input.KeyUp(e.KeyCode);
            };

            form.KeyDown += (object sender, KeyEventArgs e) => {
                input.KeyDown(e.KeyCode);
            };
        }
        public void TestNoLongerReportsKeyAsPressedAfterKeyUp()
        {
            _input.SetUserId(1);

            _input.KeyDown(Keys.Enter);

            Assert.True(_input.IsKeyDown(Keys.Enter));

            _input.KeyUp(Keys.Enter);

            Assert.False(_input.IsKeyDown(Keys.Enter));
        }