If "onbeforeselectionchange" returns false the selection doesn't happen, you could've just tried that
I did try the onbeforeselectionchange function, it didn't work well, the problem is that the function has 1 param - event, but based on the user action (if click it has event.target show what user clicked, but updown key pressed event doesn't have that). so in the function i have to do more to determine which row it selected. is there a way that I can easily get the event source row? or in the unified way?