Branch-specific fix for keydown listeners

Don't listen for keydown when attached, stop listening when unattached.

Change-Id: Icedfa18db298a86a297bc2c7f23a927cdb09bdf0