           suppressEvent event
 
         vim.lastKeyStr = null
+
+  'popupshown': (event) ->
+    if event.target.tagName in [ 'menupopup', 'panel' ]
+      passthrough = true
+
+
+  'popuphidden': (event) ->
+    if event.target.tagName in [ 'menupopup', 'panel' ]
+      passthrough = false
 
   # When the top level window closes we should release all Vims that were 
   # associated with tabs in this window


  return keyStr

# The following listeners are installed on every top level Chrome window
windowsListener = 
  'keydown': (event) ->

    if getPref 'disabled'
      return

    try


  'keypress': (event) ->

    if passthrough or getPref 'disabled'
      return

    try
