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


C# Gtk.KeyPressEventArgs类代码示例

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


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


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