changed parameter for showPopupMenu() to take a map with "key" and "event"