<F1> Key Programming

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
cindynotbrady
Posts: 157
Joined: Wed Mar 01, 2006 3:49 pm
Location: Provo, Utah

<F1> Key Programming

Unread post by cindynotbrady »

Hi Tim,

I was looking through H&M's help, and I noticed when I am in certain screens in H&M and press <F1>, help for that screen pops up (I was looking at the Configuration > Publishing Options > Webhelp > Navigation screen).

I've documented extensively a problem we have with our <F1> function here: https://helpman.it-authoring.com/viewto ... 30&t=12979

I was wondering if you could tell me how you link the H&M help to the <F1> key. Do you use the Help Context field and have unique Context numbers, or do you use the Keywords field. We use the Keywords field, which mostly works. But the real problem we're having is the code the programmers used to tie to the help. I was just wondering if you could paste a code copy of what your <F1> code might look like, or if you could just answer my question about Help Context. A screen shot may help you better understand my question:
f1contexthelp.png
Thanks!

Cindy
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23154
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: <F1> Key Programming

Unread post by Tim Green »

Hi Cindy,
I was just wondering if you could paste a code copy of what your <F1> code might look like, or if you could just answer my question about Help Context. A screen shot may help you better understand my question:
That won't help you because it depends entirely on the programming system your developers are using. Ours work in Delphi, and my guess is that your will be using Visual Studio. You can find tutorials for that and a wide range of other programming systems here:

https://helpandmanual.com/support_tutorials.html

Note that the context numbers are not more or less effective in terms of reliability. Generally, most programmers are moving away from them now because they are error-prone as regards human interaction: Since they are only numbers they aren't human-friendly, whereas topic IDs can be descriptive, which makes it less likely that the programmer will choose the wrong one.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
cindynotbrady
Posts: 157
Joined: Wed Mar 01, 2006 3:49 pm
Location: Provo, Utah

Re: <F1> Key Programming

Unread post by cindynotbrady »

I watched how our programmers put in the <F1> key code and I understand a lot more now. I thought of a solution this weekend that might help our situation. I came into work this morning and realized the functionality does not work. I'd like this added to the wish list, perhaps. But maybe you can let me know if its even feasible.

What I'd like is to be able to add conditional tags to the Keywords field in the Topic Options, as shown below:
conditkeywords.png
That way, I can build it with or without the keywords, which is what our programmers use to tie the <F1> key to the help. I can see other users wanting as well, so we could build two different types of keyword lists depending on the output. (Maybe...I may be stretching.)
You do not have the required permissions to view the files attached to this post.
User avatar
cindynotbrady
Posts: 157
Joined: Wed Mar 01, 2006 3:49 pm
Location: Provo, Utah

Re: <F1> Key Programming

Unread post by cindynotbrady »

While I'm on this subject, I'm wondering from a programmer's perspective (ours use Visual Studio), can programmers link to an anchor within a topic for F1 field-level help?

For example, the programmer usually links to a CHM and then a topic within the CHM and the help pops up.

Could they instead link to the CHM, a topic within the CHM, and then the anchor within that topic? Would they have to use something like this:

HelpPage.chm::Maintopic.htm?topic1.htm

I like giving users a page with context, but also opening directly to the specific field help when they press <F1>. The nice part about this method would be the help search would be cleaner and not so many topics (as each field would not need their own topic. Instead, it would just link to the main topic, but to each anchor within that main topic).
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: <F1> Key Programming

Unread post by John Johann »

https://www.helpandmanual.com/help/inde ... nchors.htm may be helpful

Based on that (section Linking to anchors in Webhelp pages) and your example, you could try HelpPage.chm::Topic1.htm#anchorname
User avatar
Tim Green
Site Admin
Posts: 23154
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: <F1> Key Programming

Unread post by Tim Green »

Hi Cindy,

It's unlikely that your programmers are using the normal keywords for the F1 help. With CHM help they would be using the A-Keywords, which you can enter in Topic Options in the other box on the right. See this topic in the help for details:

https://helpandmanual.com/help/index.ht ... _akeys.htm

You can't use conditions in either the normal Keywords or the A-Keywords boxes. What you could do would be create two versions TOC of the same topic with different keywords and apply the conditions to the topics.
Could they instead link to the CHM, a topic within the CHM, and then the anchor within that topic? Would they have to use something like this:
Yes, that is a standard function of the HTML Help/CHM API (application programming interface). It should be documented for them in the tutorials for .NET referenced in the links I provided further above.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
cindynotbrady
Posts: 157
Joined: Wed Mar 01, 2006 3:49 pm
Location: Provo, Utah

Re: <F1> Key Programming

Unread post by cindynotbrady »

I tried what you suggested and I took out the keyword in the regular Keywords field in Topic Options, and instead, I pasted it into the A-Keywords for HTML Help. Then I built the help and inserted into our program where it grabs the help. When I pressed F1 from a field in our program, it did not bring up the topic I was referencing. So our programmers have not tied the F1 key correctly. I'm not sure how to tell them how to fix that.

Your idea about creating two topics is not ideal, because we would have to update help in two places (something we've tried to avoid). I guess we could create snippets for each topic (we have close to 5,000), but that seems like too much work.

I am going to research more the link you gave me about creating links in anchors using .net. Thanks for your guidance, and I'll keep you updated if something changes.
User avatar
Tim Green
Site Admin
Posts: 23154
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: <F1> Key Programming

Unread post by Tim Green »

Hi Cindy,

Just switching out the keywords without consulting with the programmers on what they are doing will almost definitely fail. They need to know what they are making their calls to and whether they are targeting A-keywords or not. There is a very specific API for that which is documented in the help file of Microsoft HTML Help Workshop (which you installed to get the CHM compiler). However, this API is accessed differently in each programming language, so they need to have both that help file and the relevant documentation for their programming language as well.

None of this is Help+Manual-specific. HM generates 100% standard CHM files and everything that works for the files HM generates applies for all CHMs.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
cindynotbrady
Posts: 157
Joined: Wed Mar 01, 2006 3:49 pm
Location: Provo, Utah

Re: <F1> Key Programming

Unread post by cindynotbrady »

Eureka! I have finally figured out the problem and I am so stinking excited! I have toiled and toiled and toiled at this, and now I have figured it out!

So what I needed to do was add the keyword to the anchor and it all worked out! Press <F1> took me directly to the topic in the main help page. I am so excited you have no idea! But now I have a ton of work in front of me. Yikes!

Thanks so much!

Cindy
Post Reply