ARCed.Scintilla.SnippetChooser.txtSnippet_KeyDown C# (CSharp) Method

txtSnippet_KeyDown() private method

private txtSnippet_KeyDown ( object sender, KeyEventArgs e ) : void
sender object
e KeyEventArgs
return void
		private void txtSnippet_KeyDown(object sender, KeyEventArgs e)
		{
			//	The built in Scintilla Command Bindings for left and right
			//	will automatically dismiss the AutoComplete Window, which
			//	we don't want. So instead we have to fake our own left and
			//	right functions
			switch (e.KeyCode)
			{
				case Keys.Right:
					this.txtSnippet.Caret.Goto(this.txtSnippet.Caret.Position + 1);
					break;
				case Keys.Left:
					this.txtSnippet.Caret.Goto(this.txtSnippet.Caret.Position - 1);
					break;
				case Keys.Enter:
				case Keys.Tab:
					if (this.txtSnippet.AutoComplete.SelectedIndex >= 0)
						this.txtSnippet.AutoComplete.Accept();
					break;
				case Keys.Escape:
					Hide();
					break;
			}
		}