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 contributions with alt command won't trigger #15395

Closed
eamodio opened this issue Nov 12, 2016 · 7 comments
Closed

Menu contributions with alt command won't trigger #15395

eamodio opened this issue Nov 12, 2016 · 7 comments
Assignees
Labels
api menus Menu items and widget issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@eamodio
Copy link
Contributor

eamodio commented Nov 12, 2016

  • VSCode Version: Version 1.8.0-insider (1.8.0-insider) fb8939b
  • OS Version: macOS Sierra 10.12.1 (16B2555)

Steps to Reproduce:

  1. Using an extension that provides an alt command to a menu, press alt while clicking the menu
  2. The alt command never seems to trigger, just the main command
@alexdima alexdima assigned jrieken and unassigned alexdima Dec 2, 2016
@jrieken jrieken added *question Issue represents a question, should be posted to StackOverflow (VS Code) upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed *question Issue represents a question, should be posted to StackOverflow (VS Code) labels Dec 2, 2016
@jrieken
Copy link
Member

jrieken commented Dec 2, 2016

This currently only works when menu items appear in the editor title, e.g when we render them. When showing them in the native context menu we cannot get the alt-behaviour to work because opening a menu stops the whole JS event loop

@jrieken jrieken added the bug Issue identified by VS Code Team member as probable bug label Dec 2, 2016
@eamodio
Copy link
Contributor Author

eamodio commented Dec 4, 2016

Instead of providing alt on click of a menu item -- what if the support was holding alt when opening the menu and then the menu would actually show the alternative options?

@jrieken jrieken added this to the January 2017 milestone Dec 9, 2016
@eamodio
Copy link
Contributor Author

eamodio commented Jan 2, 2017

@jrieken I've finally gotten around to check this out -- and am loving the new behavior. Although I have noticed that intermittently the alt menu choices "stick" meaning, I open the context menu with alt pressed and the alternates show up correctly, and then I close the menu and without pressing alt, I open the menu again and sometimes the same menu with the alternates is shown.

Also, it would be really awesome if this new behavior was supported across all the context menus, not just the editor one.

@jrieken jrieken reopened this Jan 3, 2017
@jrieken jrieken closed this as completed in 5ca45ab Jan 3, 2017
@jrieken
Copy link
Member

jrieken commented Jan 3, 2017

Yeah, thanks for getting back on this. I reverted my changes and reopened this issue. It isn't as easy as I thought... The challenge is that as soon as the context menu opens we are blind and deaf, in particular we miss when the alt-key is being released. Since there is no API as is alt key pressed right now and since we emulate that by listening to various events it's quite bad that we miss those events...

Unsure how to fix this without getting more support from electron.

@jrieken jrieken removed this from the January 2017 milestone Jan 3, 2017
@eamodio
Copy link
Contributor Author

eamodio commented Jan 3, 2017

@jrieken Nooooo. ;) Damn, that sucks -- was really loving the behavior. This should still be opened though right?

@jrieken jrieken reopened this Jan 3, 2017
@jrieken
Copy link
Member

jrieken commented Jan 3, 2017

I know... the new year shouldn't start with such bad news ;-)

@jrieken jrieken added api and removed bug Issue identified by VS Code Team member as probable bug labels Apr 21, 2017
@jrieken jrieken added the menus Menu items and widget issues label Jan 5, 2018
@jrieken
Copy link
Member

jrieken commented Jan 9, 2018

Thanks to @isidorn this now works. We added a big global event that unsets the alt-state before a menu is showing. With that we can now populate any menu with alternative action when clicking alt before opening them.

@jrieken jrieken closed this as completed Jan 9, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api menus Menu items and widget issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

3 participants