[LH4828] [RC15 HiDPI BUG] Context menu not dismissing after choice is selected

Scrivener for Windows 3 HiDPI RC15
Version Beta (1175332) 64-bit - 19 Jan 2021
running on Windows 10 Home

I’m in the binder and I right click on a document, then select from the context menu Add->New From Template->New Scene (New Scene being one of my saved templates) and the new document is added after the one I right-clicked on, but the menu (the first menu, with Add at the top—but not the submenus with New From Template or New Scene) doesn’t go away.

It should be noted, to correctly duplicate this, that—as soon as the context menu comes up, after I right click—I perform all the remain menu selections from the keyboard (because, well, it’s me—and the keyboard’s my thing.)

If I keep my hands on the mouse to perform all the steps, the menu disappears as it ought when I select my template to add.

I’m using the older keyboard bindings, so…Ctrl+T, Ctrl+N should work.

As always, I’m appreciative for any other input, but…

I am also using the older keyboard bindings.

When I look at the Project->New From Template->New Scene (New Scene being my fifth defined template), the shortcut you mention is on the first template (New Character).

If I move New Scene up in the Templates folder so it is first, then when I open the Project->New From Template->New Scene menu it is first and has the shortcut Ctrl+T, Ctrl+N associated only with that one now, so that works.

But… well… it’s only a solution for that one template, right? I still have four others I might want to get to.

Also, it doesn’t negate the fact that when the right-mouse menu is up, it ought to get dismissed when a choice is made, right? Do you happen to see that behavior?

Second, it turns out—whether my focus is in the binder or in the editor—when I use the keyboard to type Project->New From Template the first template in the list (currently New Scene) has that shortcut key sequence listed next to it.

Now, if I am in the binder and I type Ctrl+T, Ctrl+N, a new scene is created after the document selected.

But, if I’m in the editor when I try that, the Ctrl+T inserts a tab, and the Ctrl+N creates a new document under the current document. If that’s going to be the behavior in the editor, the listed keyboard shortcut is also incorrect, and that, too, is a bug.

As an aside, I like things tidy, so when I add a new template I try always to remember to select the Templates folder and do a Documents->SortAscending, resulting to the order of the templates changing as often as I add new ones.

Yep, I see what you are seeing, sort of, when selecting a template. Here is what I discovered:
Create a template in the Templates folder
Copy that template two or more times
Move to the Draft folder
Create a new document using the Ctrl+T, Ctrl+N method - you get the first template in the folder
Create a subfolder in the Draft folder and select it
Go to Documents->Default template for subdocuments and select one of the templates (not the first)
[attachment=1]Screenshot 2021-01-23 131348.png[/attachment]
Try the new document from templates keybinding - you get the first template in the template folder
Using the mouse, go to Project->New from template to see that the first template in the Templates folder has the keybinding, not the one you changed it to
[attachment=0]Screenshot 2021-01-23 132300.png[/attachment]

Templates - at least the selection of them using the keyboard - is broken.

Thanks. Hopefully these are some things that can be fixed somewhat easily.

I do like the idea of the Default Template for Subdocuments idea (how long’s that been around under my nose?!)

Since I have two different kinds of New Scene templates (what I call scenes are actually active scenes—what Dwight Swain called “scenes”.) But I also have a template for passive scenes (what Dwight Swain called “sequels”).

It would be awesome to have an Alternate Default Template for Subdocuments that could be selected with a Ctrl+Enter (or some such) keystroke in the binder, but I’m not holding my breath on something as esoteric as that.

Perhaps I’ll combine both templates into one, with an active section and a passive section, set that as default, and then just create all scenes using that. Then when I create a new scene with this combined template, I could delete the stuff I’m not using (passive stuff in an active scene, or vice versa.)

Yes, it’s very nice to know about the Default Template idea. Thanks for that.

Now if the menu—when activated by the keyboard—went bye bye like it should after a selection is made, I’d be fairly happy.

Closing the menu has been fixed and will be available in the next update.

OK, leaving aside the original bug with the context menu not closing, which Tiho’s already addressed, I saw a few other questions or comments in here related to the document templates.

First, as noted, but to be clear on the intention, the shortcut for creating a document via New From Template is always assigned to the first item within the binder template folder–that is, whichever container in the binder you’ve assigned in Project Settings to house the document templates. It’s an aid to quickly creating from your most-used document template, that’s all. Using the accelerator keys may be more helpful to you if you have many templates; you could even remove the shortcut from the first template, if you never want it and prefer to free it up for something else.

Now, as far as the selection, the New From Template submenu should reproduce the order of the documents within the templates folder in the binder. Thus, you can choose which document template gets the shortcut by moving it in the binder.

Setting a container’s Default Template for Subdocuments allows you to bypass the whole New From Template route so that instead, simply using the New Text command (or Ctrl+N, pressing Enter, etc.) creates the new document from that template rather than a standard blank text. You can still create a document from a different template via New From Template, but if you almost always want items in your “Characters” folder to be a new character sketch, you can simplify the steps by just making that sketch the folder’s default template for subdocuments.

Hold the Ctrl key while typing T, N in sequence. That will submit the entire shortcut as a single command, rather than two individual ones to increase the indent and create a new document. The new v3 theme shortcut for this is Win+Ctrl+Shift+N, which also works in the editor as well as other contexts.

You could skip the first mouse step by using Shift+F10, or the Application key if you have one. :slight_smile:

I was not experiencing that issue, probably because I was not following the steps precisely.

And this is where I was making my mistake. Indeed, setting the default template on a folder means you use the Ctrl+N keybinding and get that template you chose. It makes sense now.

I believe it only happens when you use the keyboard to select the item from the submenu. Using the mouse dismisses the context menu as expected.

Sorry, I’m stuck in my ways. Eventually, I’ll probably make the shift to the new v3 theme—long after v3 is a final release, and some kind soul has put out a PDF cheat sheet of all the shortcut keys—but I wouldn’t hold your breath waiting for it. :slight_smile:

And, I should point out, I thought I had been holding down the Ctrl key for the entire sequence (but perhaps not, because a new document is created from the default template if I do keep the Ctrl depressed throughout.) However—even when I do hold it down throughout—a new tab stop is added in at the beginning of the line where I had the cursor before pressing Ctrl T, Ctrl N.

And as for that new document, it didn’t used to be a default document from template because I hadn’t set up a default document.

As an aside: now that I’ve set up a default document, is there a way (should I desire it) I could go back to the default just being a normal—non-template document—as the default? (EDIT: I just saw the Documents->Default Document for Subdocuments has a Text option—which isn’t one of my Template names, so I assume that resets the default. Am I correct?)

Also, while I do have a default from template defined (other than actually creating a new document), is there a way to check which document is currently defined as the default?

Looking back at this post as a Preview, I see I have a whole lot of information and questions packed into a short span, for which I apologize. My brain chains things together oddly at time, it seems.

I’m sorry, not enough caffeine yet. What does Shift+F10 do? A search of the manual for F10 yields zero results.

In any case, to finally cut this off, thanks so much for the help you’ve all given and I look forward to learning more from your replies.

Does this work for you?
[attachment=0]Screenshot 2021-01-25 101451.png[/attachment]

I’ll still wait for a final release before learning shortcuts that could possibly change, but, yes. Awesome. No need for the avoidance of the holding of the breath.

Yep, that’s it.

It will be selected in the Documents > Default Templates for Subdocuments submenu for the container, so you could could check there when the container is selected

That’s a general Windows shortcut, not Scrivener specific. Shift+F10 opens the context menu (as does the Application key, but not all keyboards include that). I expect with something like AutoHotKey you could reassign some other key or combination to invoke the menu, also.

Thanks. Very useful to know.

I’m not sure what you’re saying (I think you’re probably saying that if I go to Default Templates for Subdocuments (in the Documents top menu), I will see the default template indicated somehow.)

Right now I cannot verify this as when I go there—whether my focus is in the binder or in the editor—the Default Templates for Subdocuments submenu is greyed out! (Is this a bug?)

If I press enter (right now) in the binder, I get a new document from one of my templates (this template resides in a subfolder of my Templates folder, so—since the submenu is greyed out—I cannot navigate into the subfolder to see if the currently defined default is indicated in some way.)

Just checked this out in RC16 and it’s a problem there as well.

@Charlson, sorry I’m late getting back to this. The setting is only available for items that are containers, so the submenu would be disabled if you had a single text item selected rather than a folder. Otherwise, as long as the focus is in the binder (or outliner or corkboard) with the container item selected, I can’t think of a reason the menu would normally be disabled. Are you seeing this in a new project, e.g. if you select the Research folder in the binder and then check the menu?

I began writing this post with “Perhaps I’m unclear as to the purpose of Default Template for Subdocuments”, then decided to go to the manual and read up on it first.

Now I see what you are saying. I can assign, to each and every folder, a completely different type of subdocument I want created in it when enter is pressed in that particular folder.

This is amazing!

At first I was disappointed that—once I’d defined a default template for new documents in a folder—pressing enter in a subfolder didn’t create that kind of document.

Ah, but then…

Then I discovered I can create a folder in my templates directory and give that a default document (or folder) to be created for it when enter is pressed my mind was blown.

Thank you thank you thank you.