private void OnTvSearchResultKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return) { EditItem(); } }
protected void OnKeyPress(object o, Gtk.KeyPressEventArgs evnt) { if (evnt.Event.Key == Gdk.Key.Escape) { Destroy(); } }
private void OnWindowKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Escape) { SaveAndClose(); } }
protected override void OnKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Delete && selected != null) { RemoveSelected(); } }
protected void on_ImageThumbView_key_press_event(object sender, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.e) { this.on_EditTagsButton_clicked(null, null); } }
protected void keypressed(object o, Gtk.KeyPressEventArgs args) { uint key = args.Event.KeyValue; byte[] sendbytes = new byte[1]; switch (args.Event.Key) { case Gdk.Key.Return: case Gdk.Key.KP_Enter: key = 13; break; case Gdk.Key.BackSpace: case Gdk.Key.Delete: key = 8; break; default: // don't handle anything that's not 7-bit ascii if (key > 128) { log(string.Format("ignoring {0}\n", key), 2); return; } break; } sendbytes [0] = (byte)key; port.Write(sendbytes, 0, 1); log(string.Format("sending {0}\n", key), 2); // we have handled the event - don't pass it any further args.RetVal = true; }
protected virtual void OnFindKeyPress(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Escape) { glwidget1.HasFocus = true; } }
void OnFrameKeyPress(object s, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Escape) { ScheduleAutoHide(true, true); } }
void OnEditKeyPress(object s, Gtk.KeyPressEventArgs args) { Gtk.Entry entry = (Gtk.Entry)s; if (currentCompletionData != null) { bool ret = CompletionWindowManager.PreProcessKeyEvent(args.Event.Key, (char)args.Event.Key, args.Event.State); CompletionWindowManager.PostProcessKeyEvent(args.Event.Key, (char)args.Event.Key, args.Event.State); args.RetVal = ret; } Gtk.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.ExpressionLenght); CompletionWindowManager.ShowWindow(null, c, dataList, this, ctx); } else { currentCompletionData = null; } } }); }
/* 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); }
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); } } }); }
private void OnImgKeyPress(object sender, Gtk.KeyPressEventArgs e) { if (e.Event.Key.Equals(Gdk.Key.Return) || e.Event.Key.Equals(Gdk.Key.space)) { Checked = !Checked; } }
protected virtual void onSearchbarKeyEvent(object o, Gtk.KeyPressEventArgs args) { string key = args.Event.Key.ToString(); Console.WriteLine("searchbar key: " + key); if (key.Equals("Return")) { if (!notesStore.doesNoteExist(searchbar.Text.Trim()) && searchbar.Text != null && searchbar.Text.Length > 0) { Note newNote = new Note(searchbar.Text.Trim(), ""); store.AddNode(new NoteNode(newNote)); currentNote = newNote.title; notesStore.createNote(currentNote); buf = editor.Buffer; buf.Text = ""; editor.GrabFocus(); } } else if (key.Equals("Down")) { noteslist.GrabFocus(); NoteNode node = noteslist.NodeSelection.SelectedNode as NoteNode; loadNoteToBuffer(node); } }
protected void on_TagTreeView_key_press_event(object sender, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return) { this.on_OkButto_clicked(null, null); } }
protected virtual void OnKeyPressed(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return) { Search.Click(); } }
void HandleKeyPressed(object o, KeyPressEventArgs args) { if (CurrentlySelected == null) return; if (args.Event.Key == Gdk.Key.Return && IconDoubleClicked != null) IconDoubleClicked (this, EventArgs.Empty); }
protected void OnKeyPressEvent(object o, KeyPressEventArgs e) { if (e.Event.Key == Gdk.Key.Return) { Respond(ResponseType.Ok); Hide(); } }
protected void OnTextViewMessageKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return && !args.Event.State.HasFlag(Gdk.ModifierType.ControlMask)) { buttonSend.Click(); args.RetVal = true; } }
void onKeyPressEvent_enter(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key.ToString() == "Return" || args.Event.Key.ToString() == "KP_Enter") { args.RetVal = true; llena_lista_paciente(); } }
protected virtual void OnTableKeyPress(object o, Gtk.KeyPressEventArgs args) { System.Console.WriteLine("key pressed"); if (args.Event.Key == Gdk.Key.Alt_L) { System.Console.WriteLine("key pressed"); } }
protected virtual void OnTreeExceptionsKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) { OnButtonAddClicked(null, null); args.RetVal = true; } }
public void onKeyPressEvent_enterbucar_empleado(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) { args.RetVal = true; llena_lista_empleados(); } }
public void OnKeyPress(object o, Gtk.KeyPressEventArgs args) { // only capture key presses when the cursor is over the window if (m_cursorOver) { m_sceneCamera.OnKeyPress(args); } }
protected virtual void OnEntryFilterKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) { Fill(); args.RetVal = true; } }
[GLib.ConnectBefore()] // Esto es indispensable para que funcione public void onKeyPressEvent_enter(object o, Gtk.KeyPressEventArgs args) { if (args.Event.Key.ToString() == "Return" || args.Event.Key.ToString() == "KP_Enter") { args.RetVal = true; llenando_lista_de_clientes(); } }
protected virtual void OnPreviewKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { switch (args.Event.Key) { case Gdk.Key.Escape: search.GrabFocus(); break; } }
// user event handlers protected virtual void OnKeyPress(object o, Gtk.KeyPressEventArgs args) { //System.Diagnostics.Debug.WriteLine("Key Pressed - " + args.Event.KeyValue); if (inVerticalTransition) { return; } if (args.Event.Key == Gdk.Key.Tab) { entry4.GrabFocus(); entry4.HasFocus = true; args.RetVal = true; return; } switch (args.Event.Key) { case Gdk.Key.Up: MoveForward(); args.RetVal = true; break; case Gdk.Key.Down: MoveBackward(); args.RetVal = true; break; case Gdk.Key.Left: MoveLeft(); args.RetVal = true; break; case Gdk.Key.Right: MoveRight(); args.RetVal = true; break; case Gdk.Key.Return: NodeActivated(); break; case Gdk.Key.BackSpace: ToParent(true); break; case Gdk.Key.Page_Down: ToParent(false); break; case Gdk.Key.Page_Up: NavUp(); break; case Gdk.Key.Home: slices.ActiveSlice.ReFormat(FileSlice.BY_TYPE); doScaleIn = true; break; case Gdk.Key.End: slices.ActiveSlice.ReFormat(FileSlice.BY_NAME); doScaleIn = true; break; case Gdk.Key.Escape: Application.Quit(); break; case Gdk.Key.space: ToggleSelected(); break; default: if (args.Event.Key == Gdk.Key.f && (args.Event.State & Gdk.ModifierType.ControlMask) != 0) { findEntry.Visible = true; findEntry.HasFocus = true; } else if (((IList <String>)ALPHABET).Contains(Gdk.Keyval.Name(args.Event.KeyValue).ToLower())) { slices.ActiveSlice.GoToLetter(args.Event.Key.ToString()); ChangedActive(); ActivateTransition(); } break; } return; }
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(); } }
[GLib.ConnectBefore()] // Esto es indispensable para que funcione public void onKeyPressEvent_entry_expresion(object o, Gtk.KeyPressEventArgs args) { //Console.WriteLine(Convert.ToChar(args.Event.KeyValue)); //Console.WriteLine(args.Event.Key); if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) { args.RetVal = true; llenando_lista_de_productos(); } }
[GLib.ConnectBefore()] // Esto es indispensable para que funcione public void onKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { //Console.WriteLine(Convert.ToChar(args.Event.KeyValue)); string misDigitos = ".0123456789ᄚᄆᄇᄈᄡᄉᄊᄋᄌᄍᆴ)"; if (Array.IndexOf(misDigitos.ToCharArray(), Convert.ToChar(args.Event.Key)) == -1 && args.Event.Key != Gdk.Key.BackSpace) { args.RetVal = true; } }
//close program is we hit escape void EntryKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { Console.WriteLine("DEBUG: KeyValue: " + args.Event.KeyValue); if (args.Event.KeyValue == 65307) { DestroyMostlyEverything(); mainWindowTracker.HideAll(); } }
private void OnTvDrivesKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { if (IsListReady) { if ((selectedDrive != null) && (args.Event.Key == Gdk.Key.Return)) { this.Respond(ResponseType.Ok); } } }
protected virtual void OnKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { Gdk.Key k = args.Event.Key; if (usedOrderingKeys.Contains(k)) { triggerBuyAction(usedOrderingKeys[k], null); btnOrder.GrabFocus(); } log(k.ToString()); }
protected virtual void OnKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { string key = args.Event.Key.ToString(); Console.WriteLine("global key: " + key); if (key.Equals("Escape")) { GoBackToSearch(); } }
void onKeyPressEvent(object o, Gtk.KeyPressEventArgs args) { //Console.WriteLine(args.Event.Key); //Console.WriteLine(Convert.ToChar(args.Event.Key)); string misDigitos = ".0123456789ᄚᄆᄇᄈᄡᄉᄊᄋᄌᄍᆴtrsq()"; if (Array.IndexOf(misDigitos.ToCharArray(), Convert.ToChar(args.Event.Key)) == -1 && args.Event.Key.ToString() != "BackSpace") { args.RetVal = true; } }
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; }
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); } }
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; } }
void KeyHandler (object o, KeyPressEventArgs args) { args.RetVal = true; switch (args.Event.Key) { case Gdk.Key.Down: Selected++; break; case Gdk.Key.Up: Selected--; break; case Gdk.Key.Page_Down: Selected += rows - 1; break; case Gdk.Key.Page_Up: Selected -= rows - 1; break; case Gdk.Key.End: Selected = provider.Rows; break; case Gdk.Key.Home: Selected = 0; break; case Gdk.Key.Return: if (ItemActivated != null) ItemActivated (Selected); break; default: args.RetVal = false; break; } }
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); } }
private void OnNavigateKeyPressEvent (object o, KeyPressEventArgs args) { args.RetVal = false; switch (args.Event.Key) { case Gdk.Key.Return: case Gdk.Key.KP_Enter:/* I think this is not needed, this code leads to a search twice bug when you hit return. But I leave it in in the case I've missed something. Mike if (o == buttonSearchBackward || o == buttonSearchForward) { if (!((Button)o).HasFocus) ((Button)o).Click (); }*/ break; case Gdk.Key.Down: case Gdk.Key.Up: if (o != searchEntry.Entry) { args.RetVal = true; return; } if ((args.Event.State & Gdk.ModifierType.ShiftMask) == Gdk.ModifierType.ShiftMask && o == searchEntry.Entry) { searchEntry.PopupFilterMenu (); } else { if (curSearchResult == -1) curSearchPattern = searchEntry.Entry.Text; List<string> history = GetHistory (seachHistoryProperty); if (history.Count > 0) { curSearchResult += args.Event.Key == Gdk.Key.Up ? -1 : 1; if (curSearchResult >= history.Count) curSearchResult = -1; if (curSearchResult == -1) { searchEntry.Entry.Text = curSearchPattern; } else { if (curSearchResult < -1) curSearchResult = history.Count - 1; searchEntry.Entry.Text = history [curSearchResult]; } searchEntry.Entry.Position = -1; } } args.RetVal = true; break; case Gdk.Key.N: case Gdk.Key.n: buttonSearchForward.GrabFocus (); buttonSearchForward.Click (); break; case Gdk.Key.P: case Gdk.Key.p: buttonSearchBackward.GrabFocus (); buttonSearchBackward.Click (); break; case Gdk.Key.Escape: RemoveSearchWidget (); break; case Gdk.Key.slash: searchEntry.GrabFocus (); break; case Gdk.Key.ISO_Left_Tab: if (this.IsReplaceMode) { if (o == entryReplace) { searchEntry.Entry.GrabFocus (); } else if (o == buttonReplace) { entryReplace.GrabFocus (); } else if (o == buttonReplaceAll) { buttonReplace.GrabFocus (); } else if (o == buttonSearchBackward) { buttonReplaceAll.GrabFocus (); } else if (o == buttonSearchForward) { buttonSearchBackward.GrabFocus (); } else { buttonSearchForward.GrabFocus (); } args.RetVal = true; } else { if (o == buttonSearchBackward) { searchEntry.Entry.GrabFocus (); } else if (o == buttonSearchForward) { buttonSearchBackward.GrabFocus (); } else { buttonSearchForward.GrabFocus (); } args.RetVal = true; } break; case Gdk.Key.Tab: if (this.IsReplaceMode) { if (o == entryReplace) { buttonReplace.GrabFocus (); } else if (o == buttonReplace) { buttonReplaceAll.GrabFocus (); } else if (o == buttonReplaceAll) { buttonSearchBackward.GrabFocus (); } else if (o == buttonSearchBackward) { buttonSearchForward.GrabFocus (); } else if (o == buttonSearchForward) { // textEditor.GrabFocus (); searchEntry.Entry.GrabFocus (); } else { entryReplace.GrabFocus (); } args.RetVal = true; } else { if (o == buttonSearchBackward) { buttonSearchForward.GrabFocus (); } else if (o == buttonSearchForward) { searchEntry.Entry.GrabFocus (); // textEditor.GrabFocus (); } else { buttonSearchBackward.GrabFocus (); } args.RetVal = true; } break; default: args.RetVal = true; break; } }
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; } }
// // 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; } }
// Return true if the key was consumed. public void DoKeyPress(DrawingArea canvas, KeyPressEventArgs args) { OnKeyDown (canvas, args); }
void KeyPressHandler(object o, KeyPressEventArgs args) { args.RetVal = true; switch(args.Event.Key) { case Gdk.Key.Escape: CloseDialog(); break; case Gdk.Key.Control_L: case Gdk.Key.Control_R: ControlKeyPressed = true; args.RetVal = false; break; case Gdk.Key.W: case Gdk.Key.w: if (ControlKeyPressed) CloseDialog(); else args.RetVal = false; break; default: args.RetVal = false; break; } }
void OnAccelEntryKeyPress (object sender, KeyPressEventArgs e) { Gdk.Key key = e.Event.Key; string accel; e.RetVal = true; if (accelComplete) { CurrentBinding = String.Empty; accelIncomplete = false; accelComplete = false; chord = null; if (key.Equals (Gdk.Key.BackSpace)) return; } accelComplete = false; bool combinationComplete; accel = KeyBindingManager.AccelLabelFromKey (e.Event, out combinationComplete); if (combinationComplete) { CurrentBinding = KeyBindingManager.Binding (chord, accel); accelIncomplete = false; if (chord != null) accelComplete = true; else chord = accel; } else { accel = (chord != null ? chord + "|" : string.Empty) + accel; accelIncomplete = true; CurrentBinding = accel; } }
protected override void OnKeyDown(DrawingArea canvas, KeyPressEventArgs args) { if (!PintaCore.Workspace.HasOpenDocuments) { args.RetVal = false; return; } Gdk.ModifierType modifier = args.Event.State; // If we are dragging the text, we // aren't going to handle key presses if (tracking) return; // Ignore anything with Alt pressed if ((modifier & Gdk.ModifierType.Mod1Mask) != 0) return; ctrlKey = (args.Event.Key == Gdk.Key.Control_L || args.Event.Key == Gdk.Key.Control_R); UpdateMouseCursor (); // Assume that we are going to handle the key bool keyHandled = true; if (is_editing) { switch (args.Event.Key) { case Gdk.Key.BackSpace: CurrentTextEngine.PerformBackspace(); break; case Gdk.Key.Delete: CurrentTextEngine.PerformDelete(); break; case Gdk.Key.KP_Enter: case Gdk.Key.Return: CurrentTextEngine.PerformEnter(); break; case Gdk.Key.Left: CurrentTextEngine.PerformLeft((modifier & Gdk.ModifierType.ControlMask) != 0, (modifier & Gdk.ModifierType.ShiftMask) != 0); break; case Gdk.Key.Right: CurrentTextEngine.PerformRight((modifier & Gdk.ModifierType.ControlMask) != 0, (modifier & Gdk.ModifierType.ShiftMask) != 0); break; case Gdk.Key.Up: CurrentTextEngine.PerformUp((modifier & Gdk.ModifierType.ShiftMask) != 0); break; case Gdk.Key.Down: CurrentTextEngine.PerformDown((modifier & Gdk.ModifierType.ShiftMask) != 0); break; case Gdk.Key.Home: CurrentTextEngine.PerformHome((modifier & Gdk.ModifierType.ControlMask) != 0, (modifier & Gdk.ModifierType.ShiftMask) != 0); break; case Gdk.Key.End: CurrentTextEngine.PerformEnd((modifier & Gdk.ModifierType.ControlMask) != 0, (modifier & Gdk.ModifierType.ShiftMask) != 0); break; case Gdk.Key.Next: case Gdk.Key.Prior: break; case Gdk.Key.Escape: StopEditing(false); return; case Gdk.Key.Insert: if ((modifier & Gdk.ModifierType.ShiftMask) != 0) { Gtk.Clipboard cb = Gtk.Clipboard.Get(Gdk.Atom.Intern("CLIPBOARD", false)); CurrentTextEngine.PerformPaste(cb); } else if ((modifier & Gdk.ModifierType.ControlMask) != 0) { Gtk.Clipboard cb = Gtk.Clipboard.Get(Gdk.Atom.Intern("CLIPBOARD", false)); CurrentTextEngine.PerformCopy(cb); } break; default: if ((modifier & Gdk.ModifierType.ControlMask) != 0) { if (args.Event.Key == Gdk.Key.z) { //Ctrl + Z for undo while editing. TryHandleUndo(); if (PintaCore.Workspace.ActiveDocument.History.CanUndo) { PintaCore.Workspace.ActiveDocument.History.Undo(); } return; } else { //Ignore command shortcut. return; } } else { keyHandled = TryHandleChar(args.Event); } break; } // If we processed a key, update the display if (keyHandled) { RedrawText(true, true); } } else { // If we're not editing, allow the key press to be handled elsewhere (e.g. for selecting another tool). keyHandled = false; } args.RetVal = keyHandled; }
private void OnCalendarKeyPressed(object o, KeyPressEventArgs args) { //Logger.Debug("OnCalendarKeyPressed"); switch (args.Event.Key) { case Gdk.Key.Escape: HideCalendar(false); break; //case Gdk.Key.KP_Enter: //case Gdk.Key.ISO_Enter: //case Gdk.Key.Key_3270_Enter: //case Gdk.Key.Return: //case Gdk.Key.space: //case Gdk.Key.KP_Space: // HideCalendar(true); // break; default: break; } }
private void OnCalendarKeyPressed(object o, KeyPressEventArgs args) { switch (args.Event.Key) { case Gdk.Key.Escape: HideCalendar(false); break; case Gdk.Key.KP_Enter: case Gdk.Key.ISO_Enter: case Gdk.Key.Key_3270_Enter: case Gdk.Key.Return: case Gdk.Key.space: case Gdk.Key.KP_Space: HideCalendar(true); break; default: break; } }
protected void KeyPressHandler(object o, KeyPressEventArgs args) { args.RetVal = true; switch(args.Event.Key) { case Gdk.Key.Escape: Respond(ResponseType.Cancel); break; case Gdk.Key.Control_L: case Gdk.Key.Control_R: ControlKeyPressed = true; args.RetVal = false; break; case Gdk.Key.W: case Gdk.Key.w: if (ControlKeyPressed) Respond(ResponseType.Cancel); else args.RetVal = false; break; default: args.RetVal = false; break; } }
/// <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; }
private void OnKeyPress(object o, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return) this.Respond(ResponseType.Ok); }
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; } }
void HandleFilterEntryKeyPressEvent (object o, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Tab) { mainBook.HasFocus = true; mainBook.ChildFocus (DirectionType.TabForward); args.RetVal = true; } }
/// <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(); }
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); }
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; } }
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); }
private void OnKeyPressEvent(object o, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Return) { try { System.Console.WriteLine ("Selected icon: "+_iconlistOptions.Selection[0]); _buttonOK.Click (); } catch (Exception ex) { } } }
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; } }