예제 #1
1
 private void OnTvSearchResultKeyPressEvent(object o, Gtk.KeyPressEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Return)
     {
         EditItem();
     }
 }
예제 #2
0
 protected void OnKeyPress(object o, Gtk.KeyPressEventArgs evnt)
 {
     if (evnt.Event.Key == Gdk.Key.Escape)
     {
         Destroy();
     }
 }
예제 #3
0
 private void OnWindowKeyPressEvent(object o, Gtk.KeyPressEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Escape)
     {
         SaveAndClose();
     }
 }
예제 #4
0
 protected override void OnKeyPressEvent(object o, Gtk.KeyPressEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Delete && selected != null)
     {
         RemoveSelected();
     }
 }
예제 #5
0
 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);
     }
 }
예제 #6
0
파일: Mon.cs 프로젝트: linwx2020/SiKening
        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;
        }
예제 #7
0
 protected virtual void OnFindKeyPress(object o, Gtk.KeyPressEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Escape)
     {
         glwidget1.HasFocus = true;
     }
 }
예제 #8
0
 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;
                    }
                }
            });
        }
예제 #10
0
 /* 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;
     }
 }
예제 #13
0
    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);
        }
    }
예제 #14
0
 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);
     }
 }
예제 #15
0
 protected virtual void OnKeyPressed(object o, Gtk.KeyPressEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Return)
     {
         Search.Click();
     }
 }
예제 #16
0
        void HandleKeyPressed(object o, KeyPressEventArgs args)
        {
            if (CurrentlySelected == null)
                return;

            if (args.Event.Key == Gdk.Key.Return && IconDoubleClicked != null)
                IconDoubleClicked (this, EventArgs.Empty);
        }
예제 #17
0
 protected void OnKeyPressEvent(object o, KeyPressEventArgs e)
 {
     if (e.Event.Key == Gdk.Key.Return)
     {
         Respond(ResponseType.Ok);
         Hide();
     }
 }
예제 #18
0
 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;
     }
 }
예제 #19
0
 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();
     }
 }
예제 #20
0
 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");
     }
 }
예제 #21
0
 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;
     }
 }
예제 #22
0
 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();
     }
 }
예제 #23
0
 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);
     }
 }
예제 #24
0
 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;
     }
 }
예제 #25
0
 [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();
     }
 }
예제 #26
0
 protected virtual void OnPreviewKeyPressEvent(object o, Gtk.KeyPressEventArgs args)
 {
     switch (args.Event.Key)
     {
     case Gdk.Key.Escape:
         search.GrabFocus();
         break;
     }
 }
예제 #27
0
    // 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;
    }
예제 #28
0
 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();
     }
 }
예제 #29
0
 [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();
     }
 }
예제 #30
0
        [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;
            }
        }
예제 #31
0
        //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();
            }
        }
예제 #32
0
 private void OnTvDrivesKeyPressEvent(object o, Gtk.KeyPressEventArgs args)
 {
     if (IsListReady)
     {
         if ((selectedDrive != null) && (args.Event.Key == Gdk.Key.Return))
         {
             this.Respond(ResponseType.Ok);
         }
     }
 }
예제 #33
0
 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());
 }
예제 #34
0
    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();
        }
    }
예제 #35
0
파일: vision.cs 프로젝트: nagyistge/osiris
        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;
            }
        }
예제 #36
0
        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); }
        }
예제 #38
0
 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;
     }
 }
예제 #39
0
	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;
		}
	}
예제 #40
0
        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;
			}
		}
예제 #42
0
	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;
		}
	}
예제 #43
0
	//
	// 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;
		}
	}
예제 #44
0
파일: BaseTool.cs 프로젝트: manish/Pinta
 // 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;
        }
 }
예제 #46
0
		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;
			}
		}
예제 #47
0
파일: TextTool.cs 프로젝트: Kharevich/Pinta
        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;
        }
예제 #48
0
 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;
     }
 }
예제 #49
0
파일: DateButton.cs 프로젝트: GNOME/tasque
 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;
     }
 }
예제 #50
0
 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;
        }
 }
예제 #51
0
파일: Main.cs 프로젝트: JGunning/OpenAIM
        /// <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;
        }
예제 #52
0
파일: EntryDialog.cs 프로젝트: moscrif/ide
 private void OnKeyPress(object o, KeyPressEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Return)
         this.Respond(ResponseType.Ok);
 }
예제 #53
0
		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;
			}
		}
예제 #54
0
		void HandleFilterEntryKeyPressEvent (object o, KeyPressEventArgs args)
		{
			if (args.Event.Key == Gdk.Key.Tab) {
				mainBook.HasFocus = true;
				mainBook.ChildFocus (DirectionType.TabForward);
				args.RetVal = true;
			}
		}
예제 #55
0
 /// <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();
 }
예제 #56
0
파일: PintaCanvas.cs 프로젝트: rini18/Pinta
        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);
        }
예제 #57
0
 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;
        }
 }
예제 #58
0
파일: Main.cs 프로젝트: mooxh/The-Birds
        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);
        }
예제 #59
0
 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) { }
     }
 }
예제 #60
0
 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;
        }
 }