mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Implement Unix driver
* Add more sequences related with macOS
* Helper method to map char to control keys
* Add DriverName property
* Fix error on Unix unit tests
* Fix Non-nullable property 'DriverName' must contain a non-null value when exiting constructor.
* Fix Ctrl being ignored in the range \u0001-\u001a
* Add unit test for the MapChar method
* Fix cursor visibility and cursor styles
* Avoid sometimes error when running gnome-terminal
* Captures Ctrl+Shift+Alt+D7
* Captures Ctrl+D4, Ctrl+D5, Ctrl+D6 and Ctrl+D7
* Add unit test for Ctrl+Shift+Alt+7
* Fix issue on Windows where sending AltGr+some key fail assertion
* Exclude Oem1 from assertion
* Fix regex pattern
* Remove driverName from the constructor
* Revert "Remove driverName from the constructor"
This reverts commit 004e9f9588.
* Remove driverName from the constructor
* Add generic CreateSubcomponents method avoiding redundancy
* Add v2unix profiles
* Replace with hexadecimal values
---------
Co-authored-by: Tig <tig@users.noreply.github.com>
This commit is contained in:
@@ -103,16 +103,27 @@ public class AnsiKeyboardParserTests
|
||||
yield return new object [] { "\u001b[1;2P", Key.F1.WithShift };
|
||||
yield return new object [] { "\u001b[1;3Q", Key.F2.WithAlt };
|
||||
yield return new object [] { "\u001b[1;5R", Key.F3.WithCtrl };
|
||||
|
||||
|
||||
// Keys with Alt modifiers
|
||||
yield return new object [] { "\u001ba", Key.A.WithAlt, true };
|
||||
yield return new object [] { "\u001bA", Key.A.WithShift.WithAlt, true };
|
||||
yield return new object [] { "\u001b1", Key.D1.WithAlt, true };
|
||||
|
||||
// Keys with Ctrl and Alt modifiers
|
||||
yield return new object [] { "\u001b\u0001", Key.A.WithCtrl.WithAlt, true };
|
||||
yield return new object [] { "\u001b\u001a", Key.Z.WithCtrl.WithAlt, true };
|
||||
|
||||
// Keys with Ctrl, Shift and Alt modifiers
|
||||
yield return new object [] { "\u001b\u001f", Key.D7.WithCtrl.WithShift.WithAlt, true };
|
||||
}
|
||||
|
||||
// Consolidated test for all keyboard events (e.g., arrow keys)
|
||||
[Theory]
|
||||
[MemberData (nameof (GetKeyboardTestData))]
|
||||
public void ProcessKeyboardInput_ReturnsCorrectKey (string? input, Key? expectedKey)
|
||||
public void ProcessKeyboardInput_ReturnsCorrectKey (string? input, Key? expectedKey, bool isLastMinute = false)
|
||||
{
|
||||
// Act
|
||||
Key? result = _parser.IsKeyboard (input)?.GetKey (input);
|
||||
Key? result = _parser.IsKeyboard (input, isLastMinute)?.GetKey (input);
|
||||
|
||||
// Assert
|
||||
Assert.Equal (expectedKey, result); // Verify the returned key matches the expected one
|
||||
|
||||
Reference in New Issue
Block a user