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


C# dfKeyEventArgs类代码示例

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


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

示例1: OnKeyDown

	void OnKeyDown( dfControl sender, dfKeyEventArgs args )
	{

		switch( args.KeyCode )
		{

			case KeyCode.Tab:
				if( args.Shift )
				{
					if( SelectOnShiftTab != null )
					{
						SelectOnShiftTab.Focus();
						args.Use();
					}
				}
				else if( SelectOnTab != null )
				{
					SelectOnTab.Focus();
					args.Use();
				}
				break;

			case KeyCode.LeftArrow:
				if( SelectOnLeft != null )
				{
					SelectOnLeft.Focus();
					args.Use();
				}
				break;

			case KeyCode.RightArrow:
				if( SelectOnRight != null )
				{
					SelectOnRight.Focus();
					args.Use();
				}
				break;

			case KeyCode.UpArrow:
				if( SelectOnUp != null )
				{
					SelectOnUp.Focus();
					args.Use();
				}
				break;

			case KeyCode.DownArrow:
				if( SelectOnDown != null )
				{
					SelectOnDown.Focus();
					args.Use();
				}
				break;

			default:
				break;

		}

	}
开发者ID:Elringus,项目名称:StarcorPreAlpha,代码行数:60,代码来源:ControlNavigation.cs

示例2: OnKeyDown

 void OnKeyDown( dfControl sender, dfKeyEventArgs args )
 {
     if( args.KeyCode == KeyCode.LeftArrow )
     {
         SelectPrevious();
     }
     else if( args.KeyCode == KeyCode.RightArrow )
     {
         SelectNext();
     }
 }
开发者ID:dashqasar,项目名称:GoogleMap,代码行数:11,代码来源:DemoListField.cs

示例3: OnKeyDown

 protected internal override void OnKeyDown(dfKeyEventArgs args)
 {
     if (this.ReadOnly)
     {
         return;
     }
     base.OnKeyDown(args);
     if (args.Used)
     {
         return;
     }
     KeyCode keyCode = args.KeyCode;
     switch (keyCode)
     {
         case KeyCode.RightArrow:
         {
             if (args.Control)
             {
                 if (!args.Shift)
                 {
                     this.moveToNextWord();
                 }
                 else
                 {
                     this.moveSelectionPointRightWord();
                 }
             }
             else if (!args.Shift)
             {
                 this.moveToNextChar();
             }
             else
             {
                 this.moveSelectionPointRight();
             }
             break;
         }
         case KeyCode.LeftArrow:
         {
             if (args.Control)
             {
                 if (!args.Shift)
                 {
                     this.moveToPreviousWord();
                 }
                 else
                 {
                     this.moveSelectionPointLeftWord();
                 }
             }
             else if (!args.Shift)
             {
                 this.moveToPreviousChar();
             }
             else
             {
                 this.moveSelectionPointLeft();
             }
             break;
         }
         case KeyCode.Insert:
         {
             if (args.Shift)
             {
                 string str = dfClipboardHelper.clipBoard;
                 if (!string.IsNullOrEmpty(str))
                 {
                     this.pasteAtCursor(str);
                 }
             }
             break;
         }
         case KeyCode.Home:
         {
             if (!args.Shift)
             {
                 this.moveToStart();
             }
             else
             {
                 this.selectToStart();
             }
             break;
         }
         case KeyCode.End:
         {
             if (!args.Shift)
             {
                 this.moveToEnd();
             }
             else
             {
                 this.selectToEnd();
             }
             break;
         }
         default:
         {
             switch (keyCode)
             {
//.........这里部分代码省略.........
开发者ID:HexHash,项目名称:LegacyRust,代码行数:101,代码来源:dfTextbox.cs

示例4: processKeyPress

    private void processKeyPress( dfKeyEventArgs args )
    {
        DeleteSelection();

        if( text.Length < MaxLength )
        {

            if( cursorIndex == text.Length )
            {
                text += args.Character;
            }
            else
            {
                text = text.Insert( cursorIndex, args.Character.ToString() );
            }

            cursorIndex += 1;

            OnTextChanged();
            Invalidate();

        }

        args.Use();
    }
开发者ID:BjarkeHou,项目名称:ProjectGuard,代码行数:25,代码来源:dfTextbox.cs

示例5: OnKeyPress

    protected internal override void OnKeyPress( dfKeyEventArgs args )
    {
        if( ReadOnly || char.IsControl( args.Character ) )
        {
            base.OnKeyPress( args );
            return;
        }

        // Give event observers the opportunity to cancel the event
        base.OnKeyPress( args );
        if( args.Used )
            return;

        #if !( UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8 ) || UNITY_EDITOR

        processKeyPress( args );

        #endif
    }
开发者ID:BjarkeHou,项目名称:ProjectGuard,代码行数:19,代码来源:dfTextbox.cs

示例6: OnKeyPress

    protected internal override void OnKeyPress( dfKeyEventArgs args )
    {
        if( this.IsInteractive && args.KeyCode == KeyCode.Space )
        {
            OnClick( new dfMouseEventArgs( this, dfMouseButtons.Left, 1, new Ray(), Vector2.zero, 0 ) );
            return;
        }

        base.OnKeyPress( args );
    }
开发者ID:dashqasar,项目名称:GoogleMap,代码行数:10,代码来源:dfButton.cs

示例7: processKeyboard

    private bool processKeyboard()
    {
        var activeControl = dfGUIManager.ActiveControl;
        if( activeControl == null || string.IsNullOrEmpty( Input.inputString ) || !activeControl.transform.IsChildOf( this.transform ) )
            return false;

        var inputString = Input.inputString;
        for( int i = 0; i < inputString.Length; i++ )
        {

            var ch = inputString[ i ];
            if( ch == '\b' || ch == '\n' )
                continue;

            var keyCode = (KeyCode)ch;

            var args = new dfKeyEventArgs( activeControl, keyCode, false, false, false );
            args.Character = ch;

            activeControl.OnKeyPress( args );

        }

        return true;
    }
开发者ID:zc1415926,项目名称:Unity-SelectCharacter-Scene,代码行数:25,代码来源:dfInputManager.cs

示例8: OnKeyDown

    protected internal override void OnKeyDown( dfKeyEventArgs args )
    {
        if( !scrollWithArrowKeys || args.Used )
        {
            base.OnKeyDown( args );
            return;
        }

        var horzAmount = horzScroll != null ? horzScroll.IncrementAmount : 1f;
        var vertAmount = vertScroll != null ? vertScroll.IncrementAmount : 1f;

        if( args.KeyCode == KeyCode.LeftArrow )
        {
            ScrollPosition += new Vector2( -horzAmount, 0 );
            args.Use();
        }
        else if( args.KeyCode == KeyCode.RightArrow )
        {
            ScrollPosition += new Vector2( horzAmount, 0 );
            args.Use();
        }
        else if( args.KeyCode == KeyCode.UpArrow )
        {
            ScrollPosition += new Vector2( 0, -vertAmount );
            args.Use();
        }
        else if( args.KeyCode == KeyCode.DownArrow )
        {
            ScrollPosition += new Vector2( 0, vertAmount );
            args.Use();
        }

        base.OnKeyDown( args );
    }
开发者ID:AhrenLi,项目名称:2048,代码行数:34,代码来源:dfScrollPanel.cs

示例9: OnKeyDown

 protected internal override void OnKeyDown(dfKeyEventArgs args)
 {
     if (this.Orientation != dfControlOrientation.Horizontal)
     {
         if (args.KeyCode == KeyCode.UpArrow)
         {
             dfScrollbar value = this;
             value.Value = value.Value - this.IncrementAmount;
             args.Use();
             return;
         }
         if (args.KeyCode == KeyCode.DownArrow)
         {
             dfScrollbar _dfScrollbar = this;
             _dfScrollbar.Value = _dfScrollbar.Value + this.IncrementAmount;
             args.Use();
             return;
         }
     }
     else
     {
         if (args.KeyCode == KeyCode.LeftArrow)
         {
             dfScrollbar value1 = this;
             value1.Value = value1.Value - this.IncrementAmount;
             args.Use();
             return;
         }
         if (args.KeyCode == KeyCode.RightArrow)
         {
             dfScrollbar _dfScrollbar1 = this;
             _dfScrollbar1.Value = _dfScrollbar1.Value + this.IncrementAmount;
             args.Use();
             return;
         }
     }
     base.OnKeyDown(args);
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:38,代码来源:dfScrollbar.cs

示例10: popup_KeyDown

	private void popup_KeyDown( dfControl control, dfKeyEventArgs args )
	{
		if( args.KeyCode == KeyCode.Escape || args.KeyCode == KeyCode.Return )
		{
			ClosePopup();
			this.Focus();
		}
	}
开发者ID:kidaa,项目名称:ProjectUniverse,代码行数:8,代码来源:dfDropdown.cs

示例11: OnKeyDown

    protected internal override void OnKeyDown( dfKeyEventArgs args )
    {
        try
        {

            if( !actAsSlider )
                return;

            var scrollSize = ( this.maxValue - this.minValue ) * 0.1f;

            if( args.KeyCode == KeyCode.LeftArrow )
            {
                this.Value -= scrollSize;
                args.Use();
                return;
            }
            else if( args.KeyCode == KeyCode.RightArrow )
            {
                this.Value += scrollSize;
                args.Use();
                return;
            }

        }
        finally
        {
            base.OnKeyDown( args );
        }
    }
开发者ID:AhrenLi,项目名称:2048,代码行数:29,代码来源:dfProgressBar.cs

示例12: OnKeyDown

    protected internal override void OnKeyDown( dfKeyEventArgs args )
    {
        switch( args.KeyCode )
        {
            case KeyCode.UpArrow:
                SelectedIndex = Mathf.Max( 0, selectedIndex - 1 );
                break;
            case KeyCode.DownArrow:
                SelectedIndex = Mathf.Min( items.Length - 1, selectedIndex + 1 );
                break;
            case KeyCode.Home:
                SelectedIndex = 0;
                break;
            case KeyCode.End:
                SelectedIndex = items.Length - 1;
                break;
            case KeyCode.Space:
            case KeyCode.Return:
                if( triggerButton != null )
                {
                    triggerButton.DoClick();
                }
                break;
        }

        base.OnKeyDown( args );
    }
开发者ID:piittis,项目名称:scoreProject,代码行数:27,代码来源:dfDropdown.cs

示例13: KeyEventProxy

 public void KeyEventProxy( dfControl control, dfKeyEventArgs keyEvent )
 {
     callProxyEventHandler( control, keyEvent );
 }
开发者ID:CoryBerg,项目名称:drexelNeonatal,代码行数:4,代码来源:dfEventBinding.cs

示例14: OnKeyDown

 protected internal override void OnKeyDown(dfKeyEventArgs args)
 {
     if (args.Used)
     {
         return;
     }
     if (this.allowKeyboardNavigation)
     {
         if (args.KeyCode == KeyCode.LeftArrow || args.KeyCode == KeyCode.Tab && args.Shift)
         {
             this.SelectedIndex = Mathf.Max(0, this.SelectedIndex - 1);
             args.Use();
             return;
         }
         if (args.KeyCode == KeyCode.RightArrow || args.KeyCode == KeyCode.Tab)
         {
             dfTabstrip selectedIndex = this;
             selectedIndex.SelectedIndex = selectedIndex.SelectedIndex + 1;
             args.Use();
             return;
         }
     }
     base.OnKeyDown(args);
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:24,代码来源:dfTabstrip.cs

示例15: OnKeyPress

 protected internal override void OnKeyPress(dfKeyEventArgs args)
 {
     if (this.ReadOnly || char.IsControl(args.Character))
     {
         base.OnKeyPress(args);
         return;
     }
     base.OnKeyPress(args);
     if (args.Used)
     {
         return;
     }
     this.processKeyPress(args);
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:14,代码来源:dfTextbox.cs


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