adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.27k stars 7.64k forks source link

"Alt - F" shortcut not working because of "File" menu #12782

Open rococtz opened 8 years ago

rococtz commented 8 years ago

Description

I try to use some custom shortcuts Emacs style and I need to be able to bind "Alt - F" to be work like "Ctrl + Left Arrow" (jump the word).

The problem is that when I press Alt + F my shortcut works, but the cursor becomes inactive and the focus moves on the File menu. I guess it's because in Windows the Alt key switches focus to the menu and it happens that F is the starting letter for the "File".

Same issue if I bind shortcuts that use the Alt key + letters like E (Edit menu), N (navigate menu).

Is there any way to go around this?

Steps to Reproduce

  1. Bind Alt + F shortcut to do something
  2. Try to use it (in Windows) ad observe the focus moves to the "File" menu

Expected behavior:

I expect the shortcut to work without losing the focus in favor of the File menu.

Actual behavior:

The shortcut is ran but the focus moves to the Brackets menu.

Versions

Please include the OS and what version of the OS you're running. Windows 8.1

Please include the version of Brackets. You can find it under Help \ About Brackets Release 1.7 build 1.7.0-16898 (release b0a363b71) build timestamp: Wed Jun 08 2016 12:27:56 GMT+0100

zaggino commented 8 years ago

I've reproduced this with brackets on windows but can't reproduce with brackets-electron so marking this as shell issue.

jlnwcic commented 7 years ago

Looks like the issue is Really Simple: Someone attached an Alt- command to both the "File" pull-down menu and the "Find" menu. Both can't be there at the same time. They argue.

blackmiaool commented 7 years ago

Quick fix: Hack the brackets, edit the src/nls/root/strings.js like this:

From

"FILE_MENU": "File",

To

"FILE_MENU": "zFile",

Edit all the menu names, restart the brackets, and the alt-* won't trigger the menu any longer(except alt-z).

Caveat: The shortcuts can works as normal, but they will trigger Default Beep sound. You can search change system sounds in control panel and turn off it. It's weird, but seems we have no other choice now.