When I hit shift + enter I want to run a method. I cannot get this to work.
events: {
'keypress': 'keyPressed'
},
keyPressed: function(event) {
if (event.keyCode === 13 && event.shiftKey) {
console.log('TEST');
this.createGraphicButtonClicked();
}
},
}
I have tried keyup
, keydown
, keypressed body
and others with no luck. I have also tried to do it through jQuery in the render method:
this.$(document).keypress(this.keyPressed);
this.$('body').on('keypress', this.keyPressed);
this.$(document).on('keypress', this.keyPressed);
None of these have worked. I have no clue what the deal is. What am I doing wrong?