Taken from a recent post asking the same thing, search is a great forum feature.
menu @Window {
$iif($mouse.lb,List Items): echo -a Hello in the list
$iif(!$mouse.lb,Main Items): echo -a Hello in the main
}
As stated in the previous thread, the $mouse identifier works in custom @windows, the .lb property returns $true if the event (in this case right click) occured within a listbox.