molsonkiko / JsonToolsNppPlugin

A Notepad++ plugin providing tools for JSON like linting, querying, a tree view, and CSV conversion.
Apache License 2.0
70 stars 9 forks source link

Feature Request - Escape key change focus #11

Closed vinsworldcom closed 1 year ago

vinsworldcom commented 1 year ago

Many Notepad++ docking panels allow pressing the Escape key to switch focus back to the Scintilla editing component (the buffer where you enter your text in "new-1" tabs ...)

Can this be implemented for your docking panel as well?

Cheers.

vinsworldcom commented 1 year ago

Seems to work fine, but when the selection is in the tree view, Escape sets focus to the Scintilla editing component as desired, but there is an audible system 'bell'.

Maybe similar to: https://stackoverflow.com/questions/6290967/stop-the-ding-when-pressing-enter ??

molsonkiko commented 1 year ago

Thanks for bringing this up - this is shockingly difficult to deal with for TreeView controls specifically. I looked at that same StackOverflow thread and tried literally every single one of the suggestions simultaneously, plus the solutions suggested in https://stackoverflow.com/questions/10328103/c-sharp-winforms-how-to-stop-ding-sound-in-treeview. Nothing works. I've successfully stomped out bell sounds from everything else in the application, but the TreeView really wants to teach the world to ding. As you've no doubt noticed (referenced in #10), the dinging happens for Tab, Enter, and Escape, and my attempted fixes haven't changed this.

:(

I'm not saying I'll never solve this problem, but it's looking pretty grim.

molsonkiko commented 1 year ago

The problem was between the keyboard and chair the whole time! 😝 I was trying to suppress all those keypresses on KeyUp, after the user had already pressed the key! Now the suppression happens on KeyDown, and my users can enjoy blessed silence while working with my tree view.