• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Gtk.KeyPressEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Gtk.KeyPressEventArgs的典型用法代码示例。如果您正苦于以下问题:C# KeyPressEventArgs类的具体用法?C# KeyPressEventArgs怎么用?C# KeyPressEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KeyPressEventArgs类属于Gtk命名空间,在下文中一共展示了KeyPressEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnEditKeyPress

		void OnEditKeyPress (object sender, KeyPressEventArgs args)
		{
			if (currentCompletionData != null) {
				char keyChar = (char)args.Event.Key;
				if ((args.Event.Key == Gdk.Key.Down || args.Event.Key == Gdk.Key.Up)) {
					keyChar = '\0';
				}
				var retVal = CompletionWindowManager.PreProcessKeyEvent (args.Event.Key, keyChar, args.Event.State);
				CompletionWindowManager.PostProcessKeyEvent (args.Event.Key, keyChar, args.Event.State);
				args.RetVal = retVal;
			}
			
			Application.Invoke (delegate {
				char c = (char)Gdk.Keyval.ToUnicode (args.Event.KeyValue);
				if (currentCompletionData == null && IsCompletionChar (c)) {
					string exp = entry.Text.Substring (0, entry.CursorPosition);
					currentCompletionData = GetCompletionData (exp);
					if (currentCompletionData != null) {
						DebugCompletionDataList dataList = new DebugCompletionDataList (currentCompletionData);
						CodeCompletionContext ctx = ((ICompletionWidget)this).CreateCodeCompletionContext (entry.CursorPosition - currentCompletionData.ExpressionLength);
						CompletionWindowManager.ShowWindow (null, c, dataList, this, ctx);
					}
				}
			});
		}
开发者ID:wickedshimmy,项目名称:monodevelop,代码行数:25,代码来源:ExpressionEvaluatorDialog.cs


示例2: OnKeyPress

 /* change view angle, exit upon ESC */
 public void OnKeyPress(object o, KeyPressEventArgs args)
 {
     switch (args.Event.Key) {
     case Gdk.Key.z:
         view_rotz += 5.0f;
         break;
     case Gdk.Key.Z:
         view_rotz -= 5.0f;
         break;
     case Gdk.Key.Up:
         view_rotx += 5.0f;
         break;
     case Gdk.Key.Down:
         view_rotx -= 5.0f;
         break;
     case Gdk.Key.Left:
         view_roty += 5.0f;
         break;
     case Gdk.Key.Right:
         view_roty -= 5.0f;
         break;
     case Gdk.Key.Escape:
         Gtk.Application.Quit ();
         break;
     default:
         return;
     }
     GdkWindow.InvalidateRect (Allocation, false);
 }
开发者ID:GNOME,项目名称:gtkglext-sharp,代码行数:30,代码来源:gears.cs


示例3: OnKeyPressEvent

 protected void OnKeyPressEvent(object o, KeyPressEventArgs e)
 {
     if (e.Event.Key == Gdk.Key.Return)
     {
         Respond(ResponseType.Ok);
         Hide();
     }
 }
开发者ID:robik,项目名称:Mono-D,代码行数:8,代码来源:ImportSymbolSelectionDlg.cs


示例4: HandleKeyPressed

        void HandleKeyPressed(object o, KeyPressEventArgs args)
        {
            if (CurrentlySelected == null)
                return;

            if (args.Event.Key == Gdk.Key.Return && IconDoubleClicked != null)
                IconDoubleClicked (this, EventArgs.Empty);
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:8,代码来源:IconView.cs


示例5: OnKeyPress

 public void OnKeyPress(object sender, KeyPressEventArgs args)
 {
     if (args.Event.Key.Equals(Gdk.Key.Return))
     {
         Debug.Assert(Visible);
         Debug.Assert(!string.IsNullOrWhiteSpace(cbCompletions.ActiveText));
         SelectedCompletion = cbCompletions.ActiveText;
         CompletionSelected();
     }
 }
开发者ID:jbowwww,项目名称:JGL,代码行数:10,代码来源:CodeCompletionWindow.cs


示例6: Parse

        public static string Parse(KeyPressEventArgs keyPress)
        {
            string gtkKey = keyPress.Event.Key.ToString ().ToLower ();
            if (telnetKeys.Contains (gtkKey))
                return gtkKey;
            if(tranlsateKey(ref gtkKey))
                return gtkKey;

            if(tryAsDigit(ref gtkKey))
                return gtkKey;

            if (gtkKey.Length == 1)
                return gtkKey;

            return string.Empty;
        }
开发者ID:BackupTheBerlios,项目名称:mythremotekeys,代码行数:16,代码来源:TelnetKeys.cs


示例7: OnValueTableKeyPressEvent

        protected void OnValueTableKeyPressEvent(object o, KeyPressEventArgs args)
        {
            try
            {
                if (args.Event.Key == Gdk.Key.Delete)
                {
                    TreeIter iter;
                    table.GetIter(out iter, ValueTable.Selection.GetSelectedRows()[0]);
                    int index = table.GetPath(iter).Indices[0];

                    if (index == 0 && fst.HasReferenceImage) { fst.RemovReferenceImage(); }
                    else if (fst.HasReferenceImage) { fst.RemoveFilterImage(index - 1); }
                    else { fst.RemoveFilterImage(index); }

                    saved = false;
                    UpdateTable();
                }
            }
            catch (Exception ex) { ErrorReport.ReportError("ValueTableKeyPress (Create Filterset)", ex); }
        }
开发者ID:TimeScience,项目名称:desert-deflicker,代码行数:20,代码来源:CreateFilterset.cs


示例8: HandleSlideViewKeyPressEvent

 protected virtual void HandleSlideViewKeyPressEvent(object sender, KeyPressEventArgs args)
 {
     switch(args.Event.Key) {
     case Gdk.Key.Left:
         slide_show_view.Pause();
         slide_show_view.Previous();
         args.RetVal = true;
         break;
     case Gdk.Key.Right:
         slide_show_view.Pause();
         slide_show_view.Next();
         args.RetVal = true;
         break;
     case Gdk.Key.Escape:
         slide_show_view.Stop();
         slide_show_view.Destroy ();
         args.RetVal = true;
         this.Destroy ();
         AddSlideDialogRunner.Dialog.Visible = true;
         AddSlideDialogRunner.Run ();
         AddSlideDialogRunner.ProcessResponse ();
         break;
     }
 }
开发者ID:GNOME,项目名称:mistelix,代码行数:24,代码来源:SlideShowView.cs


示例9: OniFolderIconViewKeyPress

 private void OniFolderIconViewKeyPress(object o, KeyPressEventArgs args)
 {
     switch(args.Event.Key)
        {
     case Gdk.Key.Delete:
      iFolderHolder holder = iFoldersIconView.SelectedFolder;
      if (holder != null)
      {
       if (holder.iFolder.IsSubscription)
       {
        DomainInformation domain =
     domainController.GetDomain(holder.iFolder.DomainID);
        if (domain == null ||
     domain.MemberUserID == holder.iFolder.OwnerID)
        {
     DeleteSelectedFolderFromServer();
        }
        else
        {
     RemoveMembershipFromSelectedFolder();
        }
       }
       else
       {
        RemoveSelectedFolderHandler();
       }
      }
      break;
     default:
      break;
        }
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:32,代码来源:iFolderWindow.cs


示例10: OnKeyPressEvent

 /// <summary>
 /// Closes window on Escape press.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="args">Event arguments.</param>
 private void OnKeyPressEvent(object sender, KeyPressEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Escape)
         this.Destroy();
 }
开发者ID:quequotion,项目名称:glippy,代码行数:10,代码来源:EditContentWindow.cs


示例11: OnKeyPressEvent

		void OnKeyPressEvent (object sender, KeyPressEventArgs args)
		{
			// Delete the currently selected breakpoint(s) with any delete key
			switch (args.Event.Key) {
			case Gdk.Key.Delete:
			case Gdk.Key.KP_Delete:
			case Gdk.Key.BackSpace:
				// Delete the selected breakpoints
				bool deleted = false;

				DebuggingService.Breakpoints.BreakpointRemoved -= breakpointRemovedHandler;

				foreach (TreePath path in tree.Selection.GetSelectedRows ()) {
					TreeIter iter;
					
					if (!store.GetIter (out iter, path))
						continue;
					
					var bp = (Breakpoint) store.GetValue (iter, (int) Columns.Breakpoint);
					bps.Remove (bp);
					deleted = true;
				}

				DebuggingService.Breakpoints.BreakpointRemoved += breakpointRemovedHandler;

				if (deleted) {
					args.RetVal = true;
					UpdateDisplay ();
				}

				break;
			}
		}
开发者ID:IBBoard,项目名称:monodevelop,代码行数:33,代码来源:BreakpointPad.cs


示例12: ShortcutHandle

        /// <summary>
        /// Shortcuts
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        public static bool ShortcutHandle(object sender, KeyPressEventArgs e)
        {
            bool rt = false;
            try
            {
                foreach (Core.Shortcut shortcut in Configuration.ShortcutKeylist)
                {
                    if (shortcut.control == (e.Event.State == Gdk.ModifierType.ControlMask)
                        && shortcut.keys == Core.ConvertKey(e.Event.Key) && shortcut.alt == (e.Event.State == Gdk.ModifierType.Mod1Mask))
                    {
                        Parser.parse(shortcut.data);
                        rt = true;
                    }
                }

                e.RetVal = rt;
            }
            catch (Exception fail)
            {
                Core.handleException(fail);
            }
            return rt;
        }
开发者ID:JGunning,项目名称:OpenAIM,代码行数:29,代码来源:Main.cs


示例13: MainWindow_KeyPressEvent

        void MainWindow_KeyPressEvent(object o, KeyPressEventArgs e)
        {
            if (!pressed_keys.Contains (e.Event.Key))
            {
                pressed_keys.Add (e.Event.Key);
                Logger.Log ("Key press: " + e.Event.Key.ToString ());
            }

            if (e.Event.Key == Gdk.Key.Control_L || e.Event.Key == Gdk.Key.Control_R)
            {
                cmd_map.On (true);
            }

            // Give the Canvas (and by extension the tools)
            // first shot at handling the event if
            // the mouse pointer is on the canvas
            if (IsMouseOnCanvas() || canvas_pad.Canvas.HasFocus)
            {
                canvas_pad.Canvas.DoKeyPressEvent (o, e);
            }
        }
开发者ID:JoeyScarr,项目名称:Pinta,代码行数:21,代码来源:MainWindow.cs


示例14: PintaCanvas_KeyPressEvent

        private void PintaCanvas_KeyPressEvent(object o, KeyPressEventArgs e)
        {
            // Give the current tool a chance to handle the key press
            PintaCore.Tools.CurrentTool.DoKeyPress (this, e);

            // If the tool didn't consume it, see if its a toolbox shortcut
            if (e.RetVal == null || !(bool)e.RetVal)
                if (FilterModifierKeys (e.Event.State) == ModifierType.None)
                    PintaCore.Tools.SetCurrentTool (e.Event.Key);
        }
开发者ID:rini18,项目名称:Pinta,代码行数:10,代码来源:PintaCanvas.cs


示例15: OniFolderIconViewKeyPress

 private void OniFolderIconViewKeyPress(object o, KeyPressEventArgs args)
 {
     switch(args.Event.Key)
        {
     case Gdk.Key.Delete:
      iFolderHolder holder = iFolderIconView.SelectedFolder;
      if (holder != null)
      {
       if (holder.iFolder.IsSubscription)
       {
        if ( holder.iFolder.CurrentUserID== holder.iFolder.OwnerID)
        {
     DeleteSelectedFolderFromServer();
        }
        else
        {
     RemoveMembershipFromSelectedFolder();
        }
       }
       else
       {
        RemoveSelectedFolderHandler();
       }
      }
      break;
     default:
      break;
        }
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:29,代码来源:iFolderWindow.cs


示例16: OnKeyPress

 private void OnKeyPress(object o, KeyPressEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Return)
         this.Respond(ResponseType.Ok);
 }
开发者ID:moscrif,项目名称:ide,代码行数:5,代码来源:EntryDialog.cs


示例17: HandleFilterEntryKeyPressEvent

		void HandleFilterEntryKeyPressEvent (object o, KeyPressEventArgs args)
		{
			if (args.Event.Key == Gdk.Key.Tab) {
				mainBook.HasFocus = true;
				mainBook.ChildFocus (DirectionType.TabForward);
				args.RetVal = true;
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:SelectReferenceDialog.cs


示例18: OnIndexEntryKeyPress

	//
	// Invoked when the user presses a key on the index_entry
	//
	public void OnIndexEntryKeyPress (object o, KeyPressEventArgs args)
	{
		args.RetVal = true;

		switch (args.Event.Key) {
			case Gdk.Key.Up:

				if (matches.Visible == true && index_browser.match_list.Selected != 0)
				{
					index_browser.match_list.Selected--;
				} else {
					index_browser.index_list.Selected--;
					if (matches.Visible == true)
						index_browser.match_list.Selected = index_browser.match_model.Rows - 1;
				}
				break;

			case Gdk.Key.Down:

				if (matches.Visible == true && index_browser.match_list.Selected + 1 != index_browser.match_model.Rows) {
					index_browser.match_list.Selected++;
				} else {
					index_browser.index_list.Selected++;
					if (matches.Visible == true)
						index_browser.match_list.Selected = 0;
				}
				break;

			default:
				args.RetVal = false;
				break;
		}
	}
开发者ID:remobjects,项目名称:mono-tools,代码行数:36,代码来源:browser.cs


示例19: KeyPress

        static void KeyPress(object obj, KeyPressEventArgs args)
        {
            if ( ( args.Event.Key == Gdk.Key.a ) || ( args.Event.Key == Gdk.Key.A ) )
            {
                Console.WriteLine("Left");

            }

            if ( ( args.Event.Key == Gdk.Key.d ) || ( args.Event.Key == Gdk.Key.D ) )
            {
                Console.WriteLine("Right");

            }

            if ( ( args.Event.Key == Gdk.Key.Escape ) )
            {
                Console.WriteLine("Escape Pressed");

                //close app
                Application.Quit();
            }

            //		theAgent.DrawAgents(a);
        }
开发者ID:mooxh,项目名称:The-Birds,代码行数:24,代码来源:Main.cs


示例20: keypress_event_cb

	void keypress_event_cb (object o, KeyPressEventArgs args)
	{
		switch (args.Event.Key) {
		case Gdk.Key.Left:
			if (((Gdk.ModifierType) args.Event.State &
			Gdk.ModifierType.Mod1Mask) !=0)
			CurrentTab.history.BackClicked (this, EventArgs.Empty);
			args.RetVal = true;
			break;
		case Gdk.Key.Right:
			if (((Gdk.ModifierType) args.Event.State &
			Gdk.ModifierType.Mod1Mask) !=0)
			CurrentTab.history.ForwardClicked (this, EventArgs.Empty);
			args.RetVal = true;
			break;
		case Gdk.Key.Control_L:
		case Gdk.Key.Control_R:
			HoldCtrl = true;
			break;
		case Gdk.Key.Page_Up:
			if (HoldCtrl)
				tabs_nb.PrevPage();
			break;
		case Gdk.Key.Page_Down:
			if (HoldCtrl)
				tabs_nb.NextPage();
			break;
		}
	}
开发者ID:remobjects,项目名称:mono-tools,代码行数:29,代码来源:browser.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Gtk.KeyReleaseEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Gtk.ImageMenuItem类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap