本文整理汇总了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;
}
}
示例2: OnKeyDown
void OnKeyDown( dfControl sender, dfKeyEventArgs args )
{
if( args.KeyCode == KeyCode.LeftArrow )
{
SelectPrevious();
}
else if( args.KeyCode == KeyCode.RightArrow )
{
SelectNext();
}
}
示例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)
{
//.........这里部分代码省略.........
示例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();
}
示例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
}
示例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 );
}
示例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;
}
示例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 );
}
示例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);
}
示例10: popup_KeyDown
private void popup_KeyDown( dfControl control, dfKeyEventArgs args )
{
if( args.KeyCode == KeyCode.Escape || args.KeyCode == KeyCode.Return )
{
ClosePopup();
this.Focus();
}
}
示例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 );
}
}
示例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 );
}
示例13: KeyEventProxy
public void KeyEventProxy( dfControl control, dfKeyEventArgs keyEvent )
{
callProxyEventHandler( control, keyEvent );
}
示例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);
}
示例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);
}