Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu item key not working when key is 0 #4837

Closed
Montoya opened this issue May 11, 2016 · 1 comment
Closed

Menu item key not working when key is 0 #4837

Montoya opened this issue May 11, 2016 · 1 comment
Assignees
Milestone

Comments

@Montoya
Copy link

Montoya commented May 11, 2016

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???

@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants