Nice start. Probably needs snap2grid. Some areas of the black keys also play the next white key. I'd just check black rectangles first , if one is clicked, exit checking.