• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# dfKeyEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: eventSource_KeyDown

    void eventSource_KeyDown( dfControl sourceControl, dfKeyEventArgs args )
    {
        // TODO: Check for args.Used?
        if( args.KeyCode != this.keyCode )
            return;

        var modifiersMatch =
            args.Shift == this.shiftPressed &&
            args.Control == this.controlPressed &&
            args.Alt == this.altPressed;

        if( !modifiersMatch )
            return;

        var method = target.GetMethod();
        method.Invoke( target.Component, null );
    }
开发者ID:BjarkeHou,项目名称:ProjectGuard,代码行数:17,代码来源:dfControlKeyBinding.cs


示例17: OnKeyDown

    protected internal override void OnKeyDown( dfKeyEventArgs args )
    {
        switch( args.KeyCode )
        {
            case KeyCode.PageDown:
                SelectedIndex += Mathf.FloorToInt( ( size.y - listPadding.vertical ) / itemHeight );
                break;
            case KeyCode.PageUp:
                var newIndex = SelectedIndex - Mathf.FloorToInt( ( size.y - listPadding.vertical ) / itemHeight );
                SelectedIndex = Mathf.Max( 0, newIndex );
                break;
            case KeyCode.UpArrow:
                SelectedIndex = Mathf.Max( 0, selectedIndex - 1 );
                break;
            case KeyCode.DownArrow:
                SelectedIndex += 1;
                break;
            case KeyCode.Home:
                SelectedIndex = 0;
                break;
            case KeyCode.End:
                SelectedIndex = items.Length;
                break;
        }

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


示例18: 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( this.ClickWhenSpacePressed && IsInteractive )
				{
					OpenPopup();
				}
				break;
		}

		base.OnKeyDown( args );

	}
开发者ID:kidaa,项目名称:ProjectUniverse,代码行数:29,代码来源:dfDropdown.cs


示例19: OnKeyDown

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

        var horzAmount = FontSize; // horzScrollbar != null ? horzScrollbar.IncrementAmount : FontSize;
        var vertAmount = FontSize; // vertScrollbar != null ? vertScrollbar.IncrementAmount : FontSize;

        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:kvelury,项目名称:apocalyptia,代码行数:34,代码来源:dfRichTextLabel.cs


示例20: KeyEventProxy

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# dfMarkupBox类代码示例发布时间:2022-05-24
下一篇:
C# dfControl类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap