Click here to Skip to main content
15,921,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use a program for my music practice and it would be easier if I could use it with the keyboard buttons (PC).

I want to use the arrow keys to find the rhythm and Enter key to select the rhythm (Keydown 13).

What I have tried:

I have tried this but it doesn't work. (line 600 / js). Any idea?? Thanks in advance
 events: {
      'click a': 'onPresetClick',
    'keydown a': 'keyAction'

keyAction: function(e) {
  var code = e.keyCode || e.which;    
    if(code == 13) { 
      var id = $(e.currentTarget).attr('data-preset-id');
      dispatcher.trigger(dispatcher.EventKeys.PRESET_SELECTED, presets[id]);
Updated 23-Mar-22 20:44pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900