当前位置: 首页>>代码示例>>C#>>正文


C# CompletionListWindow.PostProcessKeyEvent方法代码示例

本文整理汇总了C#中CompletionListWindow.PostProcessKeyEvent方法的典型用法代码示例。如果您正苦于以下问题:C# CompletionListWindow.PostProcessKeyEvent方法的具体用法?C# CompletionListWindow.PostProcessKeyEvent怎么用?C# CompletionListWindow.PostProcessKeyEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CompletionListWindow的用法示例。


在下文中一共展示了CompletionListWindow.PostProcessKeyEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SimulateInput

 static void SimulateInput(CompletionListWindow listWindow, string input)
 {
     foreach (char ch in input) {
         switch (ch) {
         case '8':
             listWindow.PreProcessKeyEvent (Gdk.Key.Up, '\0', Gdk.ModifierType.None);
             listWindow.PostProcessKeyEvent (Gdk.Key.Up, '\0', Gdk.ModifierType.None);
             break;
         case '2':
             listWindow.PreProcessKeyEvent (Gdk.Key.Down, '\0', Gdk.ModifierType.None);
             listWindow.PostProcessKeyEvent (Gdk.Key.Down, '\0', Gdk.ModifierType.None);
             break;
         case '4':
             listWindow.PreProcessKeyEvent (Gdk.Key.Left, '\0', Gdk.ModifierType.None);
             listWindow.PostProcessKeyEvent (Gdk.Key.Left, '\0', Gdk.ModifierType.None);
             break;
         case '6':
             listWindow.PreProcessKeyEvent (Gdk.Key.Right, '\0', Gdk.ModifierType.None);
             listWindow.PostProcessKeyEvent (Gdk.Key.Right, '\0', Gdk.ModifierType.None);
             break;
         case '\t':
             listWindow.PreProcessKeyEvent (Gdk.Key.Tab, '\t', Gdk.ModifierType.None);
             listWindow.PostProcessKeyEvent (Gdk.Key.Tab, '\t', Gdk.ModifierType.None);
             break;
         case '\b':
             listWindow.PreProcessKeyEvent (Gdk.Key.BackSpace, '\b', Gdk.ModifierType.None);
             ((TestCompletionWidget)listWindow.CompletionWidget).Backspace ();
             listWindow.PostProcessKeyEvent (Gdk.Key.BackSpace, '\b', Gdk.ModifierType.None);
             break;
         case '\n':
             listWindow.PreProcessKeyEvent (Gdk.Key.Return, '\n', Gdk.ModifierType.None);
             listWindow.PostProcessKeyEvent (Gdk.Key.Return, '\n', Gdk.ModifierType.None);
             break;
         default:
             listWindow.PreProcessKeyEvent ((Gdk.Key)ch, ch, Gdk.ModifierType.None);
             ((TestCompletionWidget)listWindow.CompletionWidget).AddChar (ch);
             listWindow.PostProcessKeyEvent ((Gdk.Key)ch, ch, Gdk.ModifierType.None);
             break;
         }
     }
 }
开发者ID:brantwedel,项目名称:monodevelop,代码行数:41,代码来源:CompletionListWindowTests.cs

示例2: SimulateInput

		static void SimulateInput (CompletionListWindow listWindow, string input)
		{
			var testCompletionWidget = ((TestCompletionWidget)listWindow.CompletionWidget);
			bool isClosed = false;
			listWindow.WindowClosed += delegate {
				isClosed = true;
			};
			foreach (char ch in input) {
				switch (ch) {
				case '8':
					listWindow.PreProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Up, '\0', Gdk.ModifierType.None));
					listWindow.PostProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Up, '\0', Gdk.ModifierType.None));
					break;
				case '2':
					listWindow.PreProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Down, '\0', Gdk.ModifierType.None));
					listWindow.PostProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Down, '\0', Gdk.ModifierType.None));
					break;
				case '4':
					listWindow.PreProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Left, '\0', Gdk.ModifierType.None));
					listWindow.PostProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Left, '\0', Gdk.ModifierType.None));
					break;
				case '6':
					listWindow.PreProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Right, '\0', Gdk.ModifierType.None));
					listWindow.PostProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Right, '\0', Gdk.ModifierType.None));
					break;
				case '\t':
					listWindow.PreProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Tab, '\t', Gdk.ModifierType.None));
					listWindow.PostProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Tab, '\t', Gdk.ModifierType.None));
					break;
				case '\b':
					listWindow.PreProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.BackSpace, '\b', Gdk.ModifierType.None));
					testCompletionWidget.Backspace ();
					listWindow.PostProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.BackSpace, '\b', Gdk.ModifierType.None));
					break;
				case '\n':
					listWindow.PreProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Return, '\n', Gdk.ModifierType.None));
					listWindow.PostProcessKeyEvent (KeyDescriptor.FromGtk (Gdk.Key.Return, '\n', Gdk.ModifierType.None));
					break;
				default:
					listWindow.PreProcessKeyEvent (KeyDescriptor.FromGtk ((Gdk.Key)ch, ch, Gdk.ModifierType.None));
					testCompletionWidget.AddChar (ch);
					listWindow.PostProcessKeyEvent (KeyDescriptor.FromGtk ((Gdk.Key)ch, ch, Gdk.ModifierType.None));
					break;
				}
				// window closed.
				if (isClosed)
					break;
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:49,代码来源:CompletionListWindowTests.cs


注:本文中的CompletionListWindow.PostProcessKeyEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。