Listview: same selection index despite different selection

For the test button attached, why do I get the same index of 1 when I revert selection back to the first item with index 0 (so should get 0) when holding Shift
When not holding shift and moving to items 2 and back to 1 , I get index 0 as expected

Test.dcf (4.9 KB)

Item 0 is always selected in your video.

Item 1 is being toggled back and forth between selected and unselected.

So it makes sense that you're getting selchanged events for item 1. It's the only item whose selection state is changing here.

The selchanged event doesn't always mean the item was selected; it means the item's selection state changed.

I see, makes sense, thanks!

Is it possible to track these events withing a single movement as a group? So that if I move by one line, which is composed of 2 events (deselection and selection), I can save a single "undo step" that will not be confused with a move that's composed on just 1 event (like only deselection in the video)