ember-key-responder icon indicating copy to clipboard operation
ember-key-responder copied to clipboard

key responder not listening after it was used once

Open SirZach opened this issue 9 years ago • 1 comments

I've set up my views/application.js to the following:

import Ember from 'ember';
export default Ember.View.extend({
  acceptsKeyResponder: true,
  didInsertElement: function () {
    this.becomeKeyResponder(false);
    this._super.apply(this, arguments);
  }),

  willDestroyElement: function () {
    this.resignKeyResponder();
   this._super.apply(this, arguments);
  }),

  shiftSpace: function () {
     //opens modal, I've tweaked the MODIFIED_KEY_EVENTS hash to listen to key code 32
  }
});

Once I open the modal and close it, the view no longer gets the shiftSpace action anymore despite my clicking everywhere to make sure it's in focus. Any suggestions on how to add key listeners to the ember app as a whole? I'm trying to implement Mac OSX Spotlight Search functionality within the app so I want it available no matter where you are in the app. Thanks!

SirZach avatar Mar 26 '15 01:03 SirZach

Is the modal calling becomeKeyResponder, and if so, with what argument?

lukemelia avatar Sep 07 '15 03:09 lukemelia