Example #1
0
		public override void DoKeyInteraction(KeyInteractionType keyInteractionType, char @char, System.Windows.Forms.KeyEventArgs eventArgs, out bool shouldUpdate)
		{
			shouldUpdate = false; 
			switch (keyInteractionType)
			{
				case KeyInteractionType.KeyPress:
					if (@char == '\b')
					{
						if (m_Text.Length > 0)
						{
							m_Text = m_Text.Substring(0, m_Text.Length - 1);
							OnTextChanged();
						}
					}
					else
					{
						m_Text += @char;
						OnTextChanged();
					}
					break;
				case KeyInteractionType.KeyUp:					
					break;
				case KeyInteractionType.KeyDown:
					if (eventArgs.KeyCode == System.Windows.Forms.Keys.Delete)
					{

					}
					break;
				default:
					base.DoKeyInteraction(keyInteractionType, @char, eventArgs, out shouldUpdate);
					break;
			}			
		}
Example #2
0
		public override void DoKeyInteraction(KeyInteractionType keyInteractionType, char @char, System.Windows.Forms.KeyEventArgs eventArgs, out bool shouldUpdate)
		{
			base.DoKeyInteraction(keyInteractionType, @char, eventArgs, out shouldUpdate);

			if (keyInteractionType == KeyInteractionType.KeyDown)
			{
				if (eventArgs.KeyData == System.Windows.Forms.Keys.PageUp)
				{
					m_TopVisibleLine -= (m_NumberOfLines / 2);
					
					if (m_TopVisibleLine < m_ConsoleBuffer.TopLine)
					{
						m_TopVisibleLine = m_ConsoleBuffer.TopLine;
					}
				} 
				else if (eventArgs.KeyData == System.Windows.Forms.Keys.PageDown)
				{
					m_TopVisibleLine += (m_NumberOfLines / 2);

					if (m_TopVisibleLine > m_ConsoleBuffer.BottomLine - 1)
					{
						m_TopVisibleLine = m_ConsoleBuffer.BottomLine - 1;
					}
				}
				else if (eventArgs.KeyData == System.Windows.Forms.Keys.Up)
				{
					m_TopVisibleLine -= 1;

					if (m_TopVisibleLine < m_ConsoleBuffer.TopLine)
					{
						m_TopVisibleLine = m_ConsoleBuffer.TopLine;
					}
				}
				else if (eventArgs.KeyData == System.Windows.Forms.Keys.Down)
				{
					m_TopVisibleLine += 1;

					if (m_TopVisibleLine > m_ConsoleBuffer.BottomLine - 1)
					{
						m_TopVisibleLine = m_ConsoleBuffer.BottomLine - 1;
					}
				}
			}
		}