Cleans up key handling in drivers (was "fixes VkeyPacketSimulator is 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 <tig@users.noreply.github.com>
Co-authored-by: Tig Kindel <tig@kindel.com>
This commit is contained in:
BDisp
2024-01-04 19:37:01 +00:00
committed by GitHub
parent bc41d9bc09
commit 0484fc8bf9
32 changed files with 7578 additions and 6189 deletions

View File

@@ -64,7 +64,7 @@ namespace Terminal.Gui.ViewsTests {
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
DateField df = new DateField (DateTime.Parse ("12/12/1971"));
df.ReadOnly = true;
Assert.True (df.NewKeyDownEvent (new (KeyCode.DeleteChar)));
Assert.True (df.NewKeyDownEvent (new (KeyCode.Delete)));
Assert.Equal (" 12/12/1971", df.Text);
df.ReadOnly = false;
Assert.True (df.NewKeyDownEvent (new (KeyCode.D | KeyCode.CtrlMask)));