-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VkeyPacketSimulator
scenario is broken
#3054
Comments
Here a prove that the keyboard implementation still failing to invoke events before the derived class. The original unit test is asserting for the [Fact]
public void AllViews_KeyDown_All_EventsFire ()
{
foreach (var view in TestHelpers.GetAllViews ()) {
if (view == null) {
_output.WriteLine ($"ERROR: null view from {nameof (TestHelpers.GetAllViews)}");
continue;
}
_output.WriteLine ($"Testing {view.GetType ().Name}");
bool keyDown = false;
view.KeyDown += (s, a) => {
a.Handled = false; // don't handle it so the other events are called
keyDown = true;
};
bool invokingKeyBindings = false;
view.InvokingKeyBindings += (s, a) => {
a.Handled = false; // don't handle it so the other events are called
invokingKeyBindings = true;
};
bool keyDownProcessed = false;
view.ProcessKeyDown += (s, a) => {
a.Handled = true;
keyDownProcessed = true;
};
if (view is TextView) {
Assert.True (view.NewKeyDownEvent (Key.Backspace));
} else {
Assert.True (view.NewKeyDownEvent (Key.A)); // this will be true because the ProcessKeyDown event handled it
}
Assert.True (keyDown);
Assert.True (invokingKeyBindings);
Assert.True (keyDownProcessed);
view.Dispose ();
}
} |
Please submit this as a new Issue. |
There is no kind of magic to get the right |
If going from a KeyCode to a ConsoleKey is required, shouldn't we adjust the definition of KeyCode so it can be done easily? |
That it's only needed in the case the ConsoleKey.Packet is used but we can add to the |
Instead of ConsoleKey and Scancode, what about making it a generic "platform specific data" as in 'object DriverData'? I don't see the need for NumColumns. People shouldn't be using Key as a substitute for Rune (or Cell). |
…broken") (#3078) * Fixes #3054. VkeyPacketSimulator scenario is broken. * Fix some key handle and unit tests. * Remove unnecessary conditional. * Improves key handling. * Also allow map capslock to shift with accented characters. * Change to MemberData. * Remove unnecessary using. * Fix merge errors. * Fixes #3095. WindowsDriver should return the mask keys to IsShift, IsAlt and IsCtrl return the right value. * Modifiers keys are valid to be handled on key down and key up. * Map KeyCode.Enter to ConsoleKey.Enter and vice versa. * Updated ScanCodeMapping table with readable constants * Documented bugs * Implemented mapping using MapVirtualKeyEx * Implemented mapping using MapVirtualKeyEx * Changed KeyCode special keys to match ConsoleKey values + max unicode codepoint * Fixed bogus CollectionNavigator impl and tests * Nuked DeleteChar. renamed InsertChar to Insert * KeyCode.Enter = ConsoleKey.Enter, not \n * Code cleanup * Added diag for keyboard layout name * Fixed AltGr support (hopefully) * Simplified code * Simplified KeyCode by removing ShiftKeys * Fixed TextView * Code cleanup * Fixes cursesdriver (somewhat) * Code cleanup * netdriver wip * Fixed netdriver under WSL * Turned off debug spew * Removed old code --------- Co-authored-by: Tig Kindel <[email protected]> Co-authored-by: Tig Kindel <[email protected]>
Originally posted by @BDisp in #2927 (comment)
It's been broken in
v2_develop
for a while. It is made both better and worse in #2927.This issue is to track fixing it after #2927 is merged.
The text was updated successfully, but these errors were encountered: