浏览代码

Merge develop and resolving conflicts.

BDisp 2 年之前
父节点
当前提交
8d9d96f5af

+ 1 - 0
Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs

@@ -384,6 +384,7 @@ namespace Terminal.Gui {
 			return true;
 		}
 
+		Action<KeyEvent> keyDownHandler;
 		Action<KeyEvent> keyHandler;
 		Action<KeyEvent> keyUpHandler;
 		private CursorVisibility savedCursorVisibility;

+ 2 - 1
Terminal.Gui/Views/ContextMenu.cs

@@ -132,7 +132,8 @@ namespace Terminal.Gui {
 				Y = position.Y,
 				Width = 0,
 				Height = 0,
-				UseSubMenusSingleFrame = this.UseSubMenusSingleFrame
+				UseSubMenusSingleFrame = UseSubMenusSingleFrame,
+				Key = Key
 			};
 
 			menuBar.isContextMenuLoading = true;

+ 24 - 0
UnitTests/ConsoleDriverTests.cs

@@ -608,6 +608,30 @@ namespace Terminal.Gui.ConsoleDrivers {
 			Application.Run (win);
 			Application.Shutdown ();
 		}
+		
+		[Theory]
+		[InlineData(0x0000001F, 0x241F)]
+		[InlineData(0x0000007F, 0x247F)]
+		[InlineData(0x0000009F, 0x249F)]
+		[InlineData(0x0001001A, 0x241A)]
+		public void MakePrintable_Converts_Control_Chars_To_Proper_Unicode (uint code, uint expected)
+		{
+			var actual = ConsoleDriver.MakePrintable(code);
+				
+			Assert.Equal (expected, actual.Value);
+		}
+		
+		[Theory]
+		[InlineData(0x20)]
+		[InlineData(0x7E)]
+		[InlineData(0xA0)]
+		[InlineData(0x010020)]
+		public void MakePrintable_Does_Not_Convert_Ansi_Chars_To_Unicode (uint code)
+		{
+			var actual = ConsoleDriver.MakePrintable(code);
+				
+			Assert.Equal (code, actual.Value);
+		}
 
 		/// <summary>
 		/// Sometimes when using remote tools EventKeyRecord sends 'virtual keystrokes'.