public static void HandleKeyReleaseEvent(object o, KeyReleaseEventArgs args)
        {
            int platform = (int)Environment.OSVersion.Platform;
            int version = (int)Environment.OSVersion.Version.Major;
            Gdk.ModifierType modifier;

            //Kind of MacOSX
            if ((platform == 4 || platform == 6 || platform == 128) && version > 8)
                modifier = Gdk.ModifierType.MetaMask | Gdk.ModifierType.Mod1Mask;
            //Kind of Windows or Unix
            else
                modifier = Gdk.ModifierType.ControlMask;

            //CTRL+C
            if ((args.Event.Key == Gdk.Key.Cyrillic_es || args.Event.Key == Gdk.Key.Cyrillic_ES) && args.Event.State.HasFlag(modifier)) {
                Widget w = (o as Window).Focus;
                CopyToClipboard (w);
            }//CTRL+X
            else if ((args.Event.Key == Gdk.Key.Cyrillic_che || args.Event.Key == Gdk.Key.Cyrillic_CHE) && args.Event.State.HasFlag(modifier)) {
                Widget w = (o as Window).Focus;
                CutToClipboard (w);
            }//CTRL+V
            else if ((args.Event.Key == Gdk.Key.Cyrillic_em || args.Event.Key == Gdk.Key.Cyrillic_EM) && args.Event.State.HasFlag(modifier)) {
                Widget w = (o as Window).Focus;
                PasteFromClipboard (w);
            }
        }
Exemple #2
0
 protected virtual void OnEntrPasswordKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Return)
     {
         Login();
     }
 }
Exemple #3
0
 public void check_deletion(object sender, Gtk.KeyReleaseEventArgs args)
 {
     Gdk.Key key = args.Event.Key;
     if (key == Gdk.Key.BackSpace)
     {
         if (this.buffer.Text == "")
         {
             if (this.marked_for_deletion)
             {
                 this.remove();                     // Remove the window
             }
             else
             {
                 this.marked_for_deletion = true;
             }
         }
         else
         {
             if (this.marked_for_deletion)
             {
                 this.marked_for_deletion = false;
             }
         }
     }
     else if (key != Gdk.Key.BackSpace && this.marked_for_deletion)
     {
         this.marked_for_deletion = false;
     }
 }
Exemple #4
0
 protected virtual void OnEntrNameKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Return)
     {
         OnButtonOkClicked(null, null);
     }
 }
 protected void OnReferencesTreeViewKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Delete)
     {
         RemoveReference(null, null);
     }
 }
Exemple #6
0
 void HeaderKeyRelease(object ob, Gtk.KeyReleaseEventArgs a)
 {
     if (a.Event.Key == Gdk.Key.Control_L || a.Event.Key == Gdk.Key.Control_R)
     {
         allowPlaceholderDocking = true;
         frame.UpdatePlaceholder(item, Allocation.Size, true);
     }
 }
Exemple #7
0
        protected virtual void OnEntrAccelKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
        {
            string accel = entrAccel.Text;

            if (accel.EndsWith("+"))
            {
                entrAccel.Text = "";
            }
        }
Exemple #8
0
        void HeaderKeyRelease(object ob, Gtk.KeyReleaseEventArgs a)
        {
            var t = mTabs.ElementAt(m_CurrentTab).DockItemTitleTab;

            if (a.Event.Key == Gdk.Key.Control_L || a.Event.Key == Gdk.Key.Control_R)
            {
                allowPlaceholderDocking = true;
                t.frame.UpdatePlaceholder(t.item, Allocation.Size, true);
            }
        }
 /// <summary>Execute the event when the Enter key has been pressed on the Url Entry</summary>
 /// <param name="sender">An object that contains the sender data.</param>
 /// <param name="e">An EventArgs object that contains the event data.</param>
 private void Browser_URLKeyReleased(object sender, Gtk.KeyReleaseEventArgs e)
 {
     if (e.Event.Key == Gdk.Key.Return)
     {
         if (browser != null)
         {
             browser.LoadUrl(tbxReferenceURL.Text);
         }
     }
 }
Exemple #10
0
 protected void OnEntry3KeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Return)
     {
         if (!CheckForm())
         {
             return;
         }
         this.Respond(ResponseType.Ok);
     }
 }
Exemple #11
0
 public void check_shortcuts(object sender, Gtk.KeyReleaseEventArgs args)
 {
     Gdk.Key key = args.Event.Key;
     if (key == Gdk.Key.Escape && this.notes_showing)
     {
         this.HideNotes();
     }
     else if (key == Gdk.Key.q)
     {
         Application.Quit();
     }
 }
Exemple #12
0
 protected virtual void OnCalendarKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Escape)
     {
         calendar.Date = new DateTime(originalDate.Year, originalDate.Month, originalDate.Day);
         Close();
     }
     if (args.Event.Key == Gdk.Key.Return)
     {
         Close();
     }
 }
Exemple #13
0
    public void MyKeyReleaseEventHandler(object o, KeyReleaseEventArgs args)
    {
        if ((Gdk.Key.c == args.Event.Key) && ((args.Event.State & Gdk.ModifierType.ControlMask) != 0))
            {
                TreeIter iter;
                TreeModel model;
                if (!(Selection.GetSelected (out model, out iter))) return;

                string path = model.GetValue(iter, 1).ToString();
                Clipboard primary = Clipboard.Get(Gdk.Atom.Intern ("PRIMARY", false));
                primary.Text = path;
            }
    }
 protected void OnKeyReleaseEvent(object sender, Gtk.KeyReleaseEventArgs args)
 {
     if (enableKeyboardInput.Active && args != null)
     {
         Gdk.Key key = (Gdk.Key)args.Event.KeyValue;            //otherwise unpredictable behaviour when spawning a new thread
         SpawnThread(delegate()
         {
             foreach (KeyNode node in keyNodeStore)
             {
                 if (node.Key == key)
                 {
                     node.Pressed = false;
                     if (node.KeyCommand == KeyCommand.Backward)
                     {
                         backPressed = false;
                         SendVehicleCommand();
                     }
                     if (node.KeyCommand == KeyCommand.Forward)
                     {
                         forwardPressed = false;
                         SendVehicleCommand();
                     }
                     if (node.KeyCommand == KeyCommand.SpinLeft)
                     {
                         leftPressed = false;
                         SendVehicleCommand();
                     }
                     if (node.KeyCommand == KeyCommand.SpinRight)
                     {
                         rightPressed = false;
                         SendVehicleCommand();
                     }
                     if (node.KeyCommand == KeyCommand.Motor3Fwd)
                     {
                         motorForwardPressed = false;
                         SendMotorCommand();
                     }
                     if (node.KeyCommand == KeyCommand.Motor3Rev)
                     {
                         motorReversePressed = false;
                         SendMotorCommand();
                     }
                     break;
                 }
             }
         });
     }
 }
Exemple #15
0
    /**
     * Invoked when keyboard press is released on window
     */
    protected void OnMainDrawingAreaKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
    {
        UInt32 scancode;
        int    extended = 0;

        Gdk.EventKey e = args.Event;

        if (transport.isConnected() && sessionClient.GetSessionId() != 0)
        {
            if (inputClient.Active)
            {
                scancode = keyboard.GetRdpScancodeFromX11Keycode((UInt32)e.HardwareKeycode, ref extended);
                inputClient.SendKeyboardEvent(scancode, false, (extended == 0) ? false : true);
            }
        }
    }
Exemple #16
0
        void HandleKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
        {
            if (!mouseInsideCell)
            {
                return;
            }

            Key          k = (Key)args.Event.KeyValue;
            ModifierKeys m = args.Event.State.ToXwtValue();

            KeyEventArgs kargs = new KeyEventArgs(k, (int)args.Event.KeyValue, m, false, (long)args.Event.Time);

            ApplicationContext.InvokeUserCode(delegate {
                EventSink.OnKeyReleased(kargs);
            });
        }
Exemple #17
0
        void HandleSearchViewKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
        {
            switch (args.Event.Key)
            {
            case Gdk.Key.Return:
            case Gdk.Key.ISO_Enter:
            case Gdk.Key.Key_3270_Enter:
            case Gdk.Key.KP_Enter:
                CloseWindow(true);
                break;

            default:
                break;
            }

            args.RetVal = keyHandled = true;
        }
Exemple #18
0
        // ============================================
        // PROTECTED (Methods) Event Handlers
        // ============================================

        // ============================================
        // PRIVATE (Methods) Event Handlers
        // ============================================
        private void OnKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
        {
            if (args.Event.Key == Gdk.Key.Return &&
                (args.Event.State == Gdk.ModifierType.None ||
                 args.Event.State == Gdk.ModifierType.Mod2Mask))
            {
                int msgLength = this.inputView.Buffer.Text.Length;
                if (msgLength > 1)
                {
                    string msg = inputView.Buffer.Text.Substring(0, msgLength - 1);
                    // Send Event
                    if (Message != null)
                    {
                        Message(this, msg);
                    }
                }
                this.inputView.Buffer.Clear();
            }
        }
Exemple #19
0
        public static void TDIHandleKeyReleaseEvent(object o, KeyReleaseEventArgs args)
        {
            if (MainNotebook == null)
                return;

            int platform = (int)Environment.OSVersion.Platform;
            int version = (int)Environment.OSVersion.Version.Major;
            Gdk.ModifierType modifier;

            //Kind of MacOSX
            if ((platform == 4 || platform == 6 || platform == 128) && version > 8)
                modifier = Gdk.ModifierType.MetaMask | Gdk.ModifierType.Mod1Mask;
            //Kind of Windows or Unix
            else
                modifier = Gdk.ModifierType.ControlMask;

            //CTRL+S || CTRL+ENTER
            if ((args.Event.Key == Gdk.Key.S
                || args.Event.Key == Gdk.Key.s
                || args.Event.Key == Gdk.Key.Cyrillic_yeru
                || args.Event.Key == Gdk.Key.Cyrillic_YERU
                || args.Event.Key == Gdk.Key.Return) && args.Event.State.HasFlag(modifier)) {
                var w = MainNotebook.CurrentPageWidget;
                if (w is TabVBox) {
                    var tab = (w as TabVBox).Tab;
                    if (tab is TdiSliderTab) {
                        var dialog = (tab as TdiSliderTab).ActiveDialog;
                        dialog.SaveAndClose ();
                    }
                    if(tab is ITdiDialog)
                    {
                        (tab as ITdiDialog).SaveAndClose();
                    }
                }
            }
        }
Exemple #20
0
 private void PintaCanvas_KeyReleaseEvent(object o, KeyReleaseEventArgs e)
 {
     PintaCore.Tools.CurrentTool.DoKeyRelease (this, e);
 }
Exemple #21
0
 public override void OnKeyRelease(object o, Gtk.KeyReleaseEventArgs args)
 {
     // do nothing
 }
Exemple #22
0
        protected override void OnKeyUp(DrawingArea canvas, KeyReleaseEventArgs args)
        {
            if (args.Event.Key == Gdk.Key.Control_L || args.Event.Key == Gdk.Key.Control_R ||
                (args.Event.State & ModifierType.ControlMask) != 0)
            {
                ctrlKey = false;

                UpdateMouseCursor();
            }
        }
Exemple #23
0
        static void OnKeyRelease(object o, Gtk.KeyReleaseEventArgs args)
        {
#if DEBUG
            Console.WriteLine("Released {0}", args.Event.Key.ToString());
#endif
            #region Switch
            switch (args.Event.Key)
            {
            case Gdk.Key.q:
            case Gdk.Key.Q:
                Game.Quit();
                break;

            case Gdk.Key.s:
            case Gdk.Key.S:
                _state.KeyReleaseHandle(Key.Square);
                break;

            case Gdk.Key.x:
            case Gdk.Key.X:
                _state.KeyReleaseHandle(Key.X);
                break;

            case Gdk.Key.t:
            case Gdk.Key.T:
                _state.KeyReleaseHandle(Key.Triangle);
                break;

            case Gdk.Key.c:
            case Gdk.Key.C:
                _state.KeyReleaseHandle(Key.Circle);
                break;

            case Gdk.Key.Up:
                _state.KeyReleaseHandle(Key.Up);
                break;

            case Gdk.Key.Down:
                _state.KeyReleaseHandle(Key.Down);
                break;

            case Gdk.Key.Right:
                _state.KeyReleaseHandle(Key.Right);
                break;

            case Gdk.Key.Left:
                _state.KeyReleaseHandle(Key.Left);
                break;

            case Gdk.Key.Key_1:
                _state.KeyReleaseHandle(Key.L1);
                break;

            case Gdk.Key.Key_2:
                _state.KeyReleaseHandle(Key.L2);
                break;

            case Gdk.Key.Key_3:
                _state.KeyReleaseHandle(Key.R1);
                break;

            case Gdk.Key.Key_4:
                _state.KeyReleaseHandle(Key.R2);
                break;

            case Gdk.Key.comma:
                _state.KeyReleaseHandle(Key.Select);
                break;

            case Gdk.Key.period:
                _state.KeyReleaseHandle(Key.Start);
                break;

            default:
                break;
            }
            #endregion Switch
        }
	public void OnVideoSetSubtitleStartEndKeyRelease (object o, KeyReleaseEventArgs args) {
		if (buttonStartEndKeyPressed){
			OnVideoSetSubtitleStartEnd(o, args);
			buttonStartEndKeyPressed = false;
		}
	}
Exemple #25
0
 public void MyKeyReleaseEventHandler(object o, KeyReleaseEventArgs args)
 {
     if (Gdk.Key.Return == args.Event.Key)
             OnShowFile();
 }
 void KeyReleaseHandler(object o, KeyReleaseEventArgs args)
 {
     args.RetVal = true;
        switch(args.Event.Key)
        {
     case Gdk.Key.Control_R:
     case Gdk.Key.Control_L:
      memberList.ctrl_pressed = false;
      break;
        }
 }
Exemple #27
0
 //    private void HostPID(DateTimeOffset t0, TimePlot timeplot)
 //    {
 //        var linearMock = new LinearMosquito(10.0.In(1.min()), DateTimeOffset.UtcNow);
 //        controlledMock = linearMock.ControlledBy(new PIDAlgorithm(0.5, 0.5, 0, 0));//WithDelay(5.min());
 //
 //        clock = new Clock(t0);
 //        clock.Subscribe(linearMock);
 //        //clock.Subscribe(delayedMock);
 //
 //        // this stuff runs in another task
 //        linearMock.Receive += (ts) => {
 //            timePlot.AddActual(ts);
 //            timePlot.InvalidatePlot(true);
 //        };
 //
 //        Task.Run (() => {
 //            while(true)
 //            {
 //                clock.Tick (1.min());
 //                Thread.Sleep (speed);
 //            }
 //        });
 //    }
 protected void edPoti_KeyReleased(object o, KeyReleaseEventArgs args)
 {
     if (args.Event.Key != Gdk.Key.Return) return;
     if (args.Event.Key == Gdk.Key.Return) {
         this.btnPotiOnOff_Toggled(o, args);
     }
 }
 private void KeyReleased(object o, KeyReleaseEventArgs args )
 {
     Modifier key = Key(args.Event.Key);
     key |= ControlKeys(args.Event.State);
     DoKeyRelease(key, this);
     args.RetVal = true;
 }
    /*
    private void OnSortKindEntryChanged(object sender, EventArgs a){
        System.Console.WriteLine(CurrentIconView.Model.ToString());
        TreeModelFilter store = (TreeModelFilter)(CurrentIconView.Model);
        System.Console.WriteLine("hups");
        int activeItem = ((Gtk.ComboBox)sender).Active;
        if (activeItem == 0) {
            //store.SetSortColumnId(-1, SortType.Ascending);
        } else {
            //store.SetSortColumnId (activeItem, SortType.Ascending);
        }
    }
    private void OnSortDirectionEntryChanged(object sender, EventArgs a){

    }
    */
    private void OnFilterbarKeyReleased(object sender, KeyReleaseEventArgs e)
    {
        if (e.Event.Key == Gdk.Key.Escape){
            OnFilterbarCloseClicked(sender,e);
        }
    }
Exemple #30
0
 void Window_KeyReleaseEvent(object o, KeyReleaseEventArgs args)
 {
     Console.WriteLine("Releasing: {0}", args.Event.Key);
     CommonGuiInput.KeyRelease(args.Event.Key.ToString());
     args.RetVal = true;
 }
 protected void OnTxtURLsKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
 {
     theTimer.Stop();
     this.ShowStart();
 }
 private void OnKeyReleased( object sender, KeyReleaseEventArgs args )
 {
     //if selected node has children nodes, expanded or collapsed
     //on right/left arrow button press
     HTreeNode node = SelectedNode;
     if( node != null && node.Nodes.Count > 0 )
     {
         if( args.Event.Key == Gdk.Key.Right )
             expandNode  ( node );
         else if( args.Event.Key == Gdk.Key.Left )
             collapseNode( node );
     }
 }
Exemple #33
0
        private void OnDockKeyReleaseEvent(object o, KeyReleaseEventArgs args)
        {
            if(args.Event.Key == Gdk.Key.Escape) {
                Display.KeyboardUngrab(args.Event.Time);
                Display.PointerUngrab(args.Event.Time);
                Gtk.Grab.Remove(dock);
                dock.Hide();
                timeout = false;
                args.RetVal = true;
                return;
            }

            args.RetVal = false;
        }
Exemple #34
0
    protected void OnConsoleTextViewKeyReleaseEvent(object o, KeyReleaseEventArgs args)
    {
        //throw new NotImplementedException ();
        Int16 key = (Int16)args.Event.KeyValue;
        byte[] keyAscii = new byte[1];

        if (key < 0) {
            //consoleTextView.Buffer.Text += args.Event.Key;

            if (args.Event.Key == Gdk.Key.Delete) {
                keyAscii [0] = 127;
            } else if (args.Event.Key == Gdk.Key.Return) {
                keyAscii = new byte[2];
                keyAscii [0] = 10;
                keyAscii [1] = 13;
            } else if (args.Event.Key == Gdk.Key.Escape) {
                keyAscii [0] = 27;
            } else if (args.Event.Key == Gdk.Key.BackSpace) {
                keyAscii [0] = 08;
            } else {
                return;
            }

        } else {
            keyAscii[0] = (byte)key;
        }

        if (portStatus == true) {
            _serialPort.Write (keyAscii, 0, keyAscii.Length);
        }
    }
Exemple #35
0
	void keyrelease_event_cb (object o, KeyReleaseEventArgs args)
	{
		switch (args.Event.Key) {
		case Gdk.Key.Control_L:
		case Gdk.Key.Control_R:
			HoldCtrl = false;
			break;
		}
	}
		/// <summary>Execute the event when the Enter key has been pressed on the Url Entry</summary>
		/// <param name="sender">An object that contains the sender data.</param>
		/// <param name="e">An EventArgs object that contains the event data.</param>
		void Browser_URLKeyReleased (object sender, KeyReleaseEventArgs e)
		{
			if (e.Event.Key == Gdk.Key.Return)
			{
				if (browser != null)
					browser.LoadUrl(tbxReferenceURL.Text);
			}
		}
Exemple #37
0
        void MainWindow_KeyReleaseEvent(object o, KeyReleaseEventArgs e)
        {
            Gdk.Key key = e.Event.Key;
            pressed_keys.Remove (key);
            Logger.Log ("Key release: " + key.ToString ());

            if (key == Gdk.Key.Control_L || key == Gdk.Key.Control_R || key == Gdk.Key.Escape)
            {
                cmd_map.Off (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.DoKeyReleaseEvent (o, e);
            }
        }
Exemple #38
0
        private void OnKeyRelease(object o, Gtk.KeyReleaseEventArgs args)
        {
#if DEBUG
            Console.WriteLine("Released {0}", args.Event.Key.ToString());
#endif
            if (MessageBox != null)
            {
                return;
            }

            #region Switch
            switch (args.Event.Key)
            {
            case Gdk.Key.r:
            case Gdk.Key.R:
                Reset();
                break;

            case Gdk.Key.q:
            case Gdk.Key.Q:
                Quit();
                break;

            case Gdk.Key.s:
            case Gdk.Key.S:
                State.KeyReleaseHandle(Key.Square);
                break;

            case Gdk.Key.x:
            case Gdk.Key.X:
                State.KeyReleaseHandle(Key.X);
                break;

            case Gdk.Key.t:
            case Gdk.Key.T:
                State.KeyReleaseHandle(Key.Triangle);
                break;

            case Gdk.Key.c:
            case Gdk.Key.C:
                State.KeyReleaseHandle(Key.Circle);
                break;

            case Gdk.Key.Up:
                State.KeyReleaseHandle(Key.Up);
                break;

            case Gdk.Key.Down:
                State.KeyReleaseHandle(Key.Down);
                break;

            case Gdk.Key.Right:
                State.KeyReleaseHandle(Key.Right);
                break;

            case Gdk.Key.Left:
                State.KeyReleaseHandle(Key.Left);
                break;

            case Gdk.Key.Key_1:
                State.KeyReleaseHandle(Key.L1);
                break;

            case Gdk.Key.Key_2:
                State.KeyReleaseHandle(Key.L2);
                break;

            case Gdk.Key.Key_3:
                State.KeyReleaseHandle(Key.R1);
                break;

            case Gdk.Key.Key_4:
                State.KeyReleaseHandle(Key.R2);
                break;

            case Gdk.Key.comma:
                State.KeyReleaseHandle(Key.Select);
                break;

            case Gdk.Key.period:
                State.KeyReleaseHandle(Key.Start);
                break;

            default:
                break;
            }
            #endregion Switch
        }
		void OnAccelEntryKeyRelease (object sender, KeyReleaseEventArgs e)
		{
			if (accelIncomplete)
				CurrentBinding = chord != null ? chord : string.Empty;
		}
Exemple #40
0
 void EntryKeyUpEvent(object o, Gtk.KeyReleaseEventArgs args)
 {
 }
    protected virtual void PipeTextView_OnKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs e)
    {
        Gdk.Key theKey  = e.Event.Key;
        char    theChar = (char)e.Event.KeyValue;

        if (commandAutoCompletion)
        {
            bool controlPressed = (e.Event.State & Gdk.ModifierType.ControlMask) != 0;
            bool altPressed     = (e.Event.State & Gdk.ModifierType.Mod1Mask) != 0;

            if (Char.IsLetter(theChar) && ((theKey != Gdk.Key.Home) &&
                                           (theKey != Gdk.Key.Left) && (theKey != Gdk.Key.Right) &&
                                           (theKey != Gdk.Key.Up) && (theKey != Gdk.Key.Down) &&
                                           (theKey != Gdk.Key.Return) && (theKey != Gdk.Key.Delete) &&
                                           (theKey != Gdk.Key.BackSpace) && (theKey != Gdk.Key.End)) &&
                (!controlPressed) && (!altPressed))
            {
                // The character typed is just a letter.

                PipeTextView.Buffer.Changed -= PipeTextBuffer_OnChanged;

                string theLine = CurrentLine();

                int    lineCaretPos = CaretPos();
                string prefix       = theLine.Substring(0, lineCaretPos).TrimStart();

                if (IsAlphabetic(prefix))
                {
                    // The "prefix" is all alphabetic.

                    string suffix = MatchCommand(prefix);
                    int    i      = theLine.IndexOf(' ', lineCaretPos - 1);

                    if (i > -1)
                    {
                        // Found the space following the filter name.

                        int noOfChars = i - lineCaretPos + 1;
                        theLine = theLine.Remove(lineCaretPos - 1, noOfChars);
                        theLine = theLine.Insert(lineCaretPos - 1, suffix);
                    }
                    else
                    {
                        // No space was found.

                        theLine  = theLine.Remove(lineCaretPos - 1);
                        theLine += suffix;
                    }

                    // Update the textview's text buffer:

                    TextIter begIter = PipeTextView.Buffer.GetIterAtMark(PipeTextView.Buffer.InsertMark);
                    TextIter endIter = PipeTextView.Buffer.GetIterAtMark(PipeTextView.Buffer.InsertMark);
                    begIter.BackwardChars(begIter.LineOffset);
                    endIter.BackwardCursorPosition();
                    endIter.ForwardToLineEnd();
                    PipeTextView.Buffer.Delete(ref begIter, ref endIter);
                    PipeTextView.Buffer.Insert(ref begIter, theLine);

                    if (suffix != string.Empty)
                    {
                        // Restore the caret's original position:

                        MoveCaret(lineCaretPos);
                    }
                }

                PipeTextView.Buffer.Changed += PipeTextBuffer_OnChanged;
            }
        }

        UpdCursorLocation(PipeTextView.Buffer);
        UpdateCmdSyntax();
        UpdateControls();
    }
Exemple #42
0
    void HandleTbSearchKeyReleaseEvent(object o, KeyReleaseEventArgs args)
    {
        //get results live on key up
        staff staffMember = new staff();
        staffMember.fName = "ted";
        List<staff> searchResults = new List<staff> ();
        searchResults = staffMember.search_staff(tbSearch.Text);
        Console.WriteLine("Search Results found: "+searchResults.Count.ToString());
        //staffMember.get_staff_member();
        foreach(staff sr in searchResults)
        {

            Console.WriteLine(sr.fName+" "+sr.lName);
        }
    }
Exemple #43
0
 protected virtual void OnDrawingareaKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
 {
 }
Exemple #44
0
 void MainWindow_KeyReleaseEvent(object o, KeyReleaseEventArgs e)
 {
     // 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.DoKeyReleaseEvent (o, e);
     }
 }
Exemple #45
0
 /// <summary>
 /// We handle this because we don't see the return key in the KeyPress event handler
 /// </summary>
 private void CompletionView_KeyReleaseEvent(object o, KeyReleaseEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Return && CompletionView.Visible)
         InsertCompletionItemIntoTextBox();
 }
 /// <summary>
 /// Captures the press of the RETURN key within the query field and delegates to OnViewQuerySent
 /// </summary>
 /// <param name="o">
 /// A <see cref="System.Object"/> -- not used
 /// </param>
 /// <param name="args">
 /// A <see cref="KeyReleaseEventArgs"/> -- holding information about the key released
 /// </param>
 void OnInputKeyReleaseEvent(object o, KeyReleaseEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Return) {
         OnViewQuerySent (o, new EventArgs ());
         query_button.GrabFocus ();
     }
 }
		void FileListKeyReleaseEvent (object o, KeyReleaseEventArgs args)
		{
			if (args.Event.Key == Gdk.Key.Escape) {
				args.RetVal = true;
			}
		}
 protected void OnTreeview1KeyReleaseEvent(object o, KeyReleaseEventArgs args)
 {
     if (args.Event.Key == Gdk.Key.Tab)
     {
         var treeView = (TreeView)o;
         TreeViewColumn focusColumn;
         TreePath path;
         treeView.GetCursor(out path, out focusColumn);
         TreeViewColumn[] cols = this.treeview1.Columns;
         int focusColumnPosition = Array.IndexOf(cols, focusColumn);
         int nextColumn = focusColumnPosition + 1;
         if (nextColumn < cols.Length)
         {
             treeView.SetCursor(path, treeView.Columns[nextColumn], true);
         }
     }
 }
Exemple #49
0
 void HandleKeyReleaseEvent(object o, Gtk.KeyReleaseEventArgs args)
 {
     args.RetVal = keyHandled = true;
 }
Exemple #50
0
	void KeyReleaseHandler (object obj, KeyReleaseEventArgs args)
	{
		// nothing
	}
Exemple #51
0
        protected override void OnKeyUp(DrawingArea canvas, KeyReleaseEventArgs args)
        {
            switch (args.Event.Key) {
            case Gdk.Key.Control_L:
            case Gdk.Key.Control_R:
                TimeSpan heldDuration = (DateTime.Now - this.controlKeyDownTime);

                // If the user taps Ctrl, then we should toggle the visiblity of the moveNub
                if (heldDuration < this.controlKeyDownThreshold) {
                    this.enableNub = !this.enableNub;
                }

                this.controlKeyDown = false;
                break;
            }

            base.OnKeyUp (canvas, args);
        }
Exemple #52
0
 public void DoKeyRelease(DrawingArea canvas, KeyReleaseEventArgs args)
 {
     OnKeyUp (canvas, args);
 }
		void OnDefaultKeyEntryKeyRelease (object sender, KeyReleaseEventArgs e)
		{
			if (accelIncomplete)
				CurrentKey = chord != null ? chord : string.Empty;
		}
 void KeyReleaseHandler(object o, KeyReleaseEventArgs args)
 {
     args.RetVal = false;
        switch(args.Event.Key)
        {
     case Gdk.Key.Control_L:
     case Gdk.Key.Control_R:
      ControlKeyPressed = false;
      break;
     default:
      break;
        }
 }
Exemple #55
0
 protected virtual void OnKeyUp(DrawingArea canvas, Gtk.KeyReleaseEventArgs args)
 {
 }