Added logic to properly do the Ctrl Del keystroke

This commit is contained in:
John Jenko 2017-01-26 14:56:57 +00:00
parent 0659754ccf
commit 9d6bfa6bf9

View File

@ -2316,12 +2316,21 @@ namespace Volian.Controls.Library
} }
} }
if (SelectionStart != TextLength) if (SelectionStart != TextLength)
{
if (e.Control)
{
// B2016-245 [ctrl][delete] deletes rest of word to the right of the cursor
RtbSendKeys("+^{RIGHT}{BS}"); //[shift][ctrl][right arrow] (selects rest of word to the right) folowed by a backspace (delete)
e.SuppressKeyPress = true;
}
else
{ {
SelectionStart++;// A Delete can be accomplished with a right arrow followed by a backspace. SelectionStart++;// A Delete can be accomplished with a right arrow followed by a backspace.
RtbSendKeys("{BS}"); // This is done due to a glitch in the RichTextBox that sometimes causes a beep rather than a delete RtbSendKeys("{BS}"); // This is done due to a glitch in the RichTextBox that sometimes causes a beep rather than a delete
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} }
} }
}
else else
HandleDeleteKeyWithSelectedText(e, null); HandleDeleteKeyWithSelectedText(e, null);
break; break;