Skip to content

Instantly share code, notes, and snippets.

@grokys
grokys / Version1
Last active August 29, 2015 14:11 — forked from SuperJMN/Version1
protected override void OnKeyDown(KeyEventArgs e)
{
var modifiers = e.Device.Modifiers;
var key = e.Key;
if (IsNavigational(key))
{
var shouldSelectAlong = modifiers.HasFlag(ModifierKeys.Shift);
var isWordJumpEnabled = modifiers.HasFlag(ModifierKeys.Control);
this.MoveCaret(TranslateToDirection(key, modifiers), shouldSelectAlong, isWordJumpEnabled);