Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Menu item key not working when key is 0  #4837

@Montoya

Description

@Montoya

Hi, the following code on Mac with nwjs version 0.14.2:

var editHUDItem = new nw.MenuItem({
  type: 'checkbox',
  label: 'Disable HUD in Play Mode',
  key: '0', 
  checked: hudDisabled,
  click: function() {
    if(hudDisabled) {
      hudDisabled = false;
      showAnimatorControls();
      localStorage.setItem('hud-disabled', 'false');
    }
    else {
      hudDisabled = true;
      hideAnimatorControls();
      localStorage.setItem('hud-disabled', 'true');
    }
  }
});

Everything works fine except the key: 0, nothing happens when I press 0. Meanwhile:

openGIFItem = new nw.MenuItem({
  type: 'normal',
  label: 'Open GIF...',
  key: 'o',
  modifiers: 'cmd',
  click: function() {
    if(document.body.className === 'editing') {
      if(giffaSet.length >= maxNumKeys) {
        displayError({body:'No available GIF slots, please remove a GIF first'});
      }
      else {
        document.getElementById('magic-file-upload-overlay').click();
      }
    }
    else {
      displayNotice({body:'Select a collection or choose "create" first'});
    }
  }
});

This works fine, when I press cmd + o. What could be the problem here???

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions