Skip to content

Commit

Permalink
Merge pull request #168 from AvaloniaUI/fixes/161-right-button-release
Browse files Browse the repository at this point in the history
Detect right button release as well as press.
  • Loading branch information
grokys authored Apr 21, 2023
2 parents ac64003 + 1ce3996 commit f07456a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,16 @@ private void PointerSelect(TreeDataGrid sender, TreeDataGridRow row, PointerEven

var commandModifiers = AvaloniaLocator.Current.GetService<PlatformHotkeyConfiguration>()?.CommandModifiers;
var toggleModifier = commandModifiers is not null ? e.KeyModifiers.HasFlag(commandModifiers) : false;
var isRightButton = point.Properties.PointerUpdateKind is PointerUpdateKind.RightButtonPressed or
PointerUpdateKind.RightButtonReleased;

UpdateSelection(
sender,
row.RowIndex,
select: true,
rangeModifier: e.KeyModifiers.HasFlag(KeyModifiers.Shift),
toggleModifier: toggleModifier,
rightButton: point.Properties.IsRightButtonPressed);
rightButton: isRightButton);
e.Handled = true;
}

Expand Down

0 comments on commit f07456a

Please sign in to comment.