<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: F1 Help for addin only in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7762369#M55182</link>
    <description>&lt;P&gt;Following up on this issue in a new thread:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/contextual-help-not-working-from-within-a-command/m-p/6970171" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/contextual-help-not-working-from-within-a-command/m-p/6970171&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt; &lt;BR /&gt;Jeremy&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2018 14:28:18 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2018-02-08T14:28:18Z</dc:date>
    <item>
      <title>F1 Help for addin only</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7499773#M55175</link>
      <description>&lt;P&gt;I am adding Help to my addin and want the F1 key to call my help file (CHM) for the whole form, not just for the control that has focus. I am using the following code which is working fine. My problem is that F1 triggers Revit's online help after calling mine. Is there a way to prevent this keystroke going on to Revit?&amp;nbsp;Many thanks. Dale &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            // F1 for help on any control
            if (keyData == (Keys.F1))
            {
                HelpClick();

                // This keystroke was handled, don't pass to the control with the focus
                return true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 11:50:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7499773#M55175</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2017-10-29T11:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: F1 Help for addin only</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7499788#M55176</link>
      <description>&lt;P&gt;If you were using KeyDown event then you could try setting&amp;nbsp;e.Handled = True.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KeyDown also has KeyData to check for F1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is also a HelpRequested event which I'm not familiar with but again could try setting e.Handled = True. I presume it responds to F1 but the order in the call chain for this may be too late to prrvent subsequent event handlers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a modeless form the other day and was pressing delete to delete something in the text box but the x icon in Revit&amp;nbsp;was appearing to delete an element from the model. That was fixed by setting the parent, although I knew of the parent setting thing I wasn't that concerned about it for the form in question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 12:16:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7499788#M55176</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2017-10-29T12:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: F1 Help for addin only</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7499818#M55177</link>
      <description>&lt;P&gt;Apologies for the double post. The alternative is to "&lt;EM&gt;set the form's&amp;nbsp;&lt;CODE&gt;KeyPreview&lt;/CODE&gt;&amp;nbsp;to true. This will make sure the form get the keypress messages first and if you handle it, you can set&amp;nbsp;&lt;CODE&gt;e.Handled = true&lt;/CODE&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;&amp;nbsp;so it doesn't passed down to the controls.&lt;/EM&gt;" There is a bit of online discussion and dispute as to the correct method. Dale&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 12:45:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7499818#M55177</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2017-10-29T12:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: F1 Help for addin only</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7517996#M55178</link>
      <description>&lt;P&gt;My original need was to&amp;nbsp;ensure F1 was context-sensitive to the&amp;nbsp;host form rather than the control-with-focus. I now find&amp;nbsp; that in&amp;nbsp;all&amp;nbsp;addins that I test, F1 is either disabled, or calls Autodesk's online help default page. Autodesk's own addins have their pages in the on-line help, so they&amp;nbsp;behave as expected. The code I provided initially is working perfectly with the exception that after calling&amp;nbsp;my addin context help, it continues to open Autodesk's default page. I now realise that 3rd party addins should have some method to call their&amp;nbsp;own F1 context-sensitive help independent of Autodesk's. Surely this has been addressed previously? Any advice very much appreciated. Regards, Dale&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2017 10:17:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7517996#M55178</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2017-11-05T10:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: F1 Help for addin only</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7518000#M55179</link>
      <description>&lt;P&gt;This was in the duplicate post (cancelled)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can use Revit UI API and autodesk AdWindows assembly to control the contextual help for ribbon item;&amp;nbsp; please refer to code below FYI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        /// &amp;lt;summary&amp;gt;
        /// Update ribbon item with given help uri, title, description, etc.
        /// &amp;lt;/summary&amp;gt;
        private void UpdateRibbonContexualHelp(RibbonItem item, string helpUri, 
            string title, string description, string expandDescription, Uri expandVideo)
        {
            Type itemType = item.GetType();

            var mi = itemType.GetMethod("getRibbonItem",
              BindingFlags.NonPublic | BindingFlags.Instance);

            var windowRibbonItem = mi.Invoke(item, null);
            Autodesk.Windows.RibbonItem wndRibbonItem = windowRibbonItem as Autodesk.Windows.RibbonItem;
            item.SetContextualHelp(new ContextualHelp(ContextualHelpType.Url, helpUri));

            wndRibbonItem.ToolTip = new Autodesk.Windows.RibbonToolTip()
            {
                Title = title,
                Content = description,
                ExpandedContent = expandDescription,
                ExpandedVideo = expandVideo,
            };
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I haven't tried this, but does it mean that while the Ribbon item addin form is active, F1 will call the&amp;nbsp;specified helpURL?&amp;nbsp;Dale&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2017 10:24:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7518000#M55179</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2017-11-05T10:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: F1 Help for addin only</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7521444#M55180</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Dale,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for your query.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I used the contextual help functionality a couple of times in the past and never encountered the behaviour you describe:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Multi-Version Add-in -- &lt;A href="http://thebuildingcoder.typepad.com/blog/2012/07/multi-version-add-in.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2012/07/multi-version-add-in.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;What's New in the Revit 2013 API -- &lt;A href="http://thebuildingcoder.typepad.com/blog/2013/03/whats-new-in-the-revit-2013-api.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2013/03/whats-new-in-the-revit-2013-api.html&lt;/A&gt; &amp;gt; Contextual help support&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Using Balloon Tips in Revit -- &lt;A href="http://thebuildingcoder.typepad.com/blog/2014/03/using-balloon-tips-in-revit.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/03/using-balloon-tips-in-revit.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;From Hack to App - OBJ Mesh Import to DirectShape -- &lt;A href="http://thebuildingcoder.typepad.com/blog/2015/02/from-hack-to-app-obj-mesh-import-to-directshape.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2015/02/from-hack-to-app-obj-mesh-import-to-directshape.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Unfortunately, all of these date rather far back, so I cannot guarantee that they behave as expected nowadays.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you are setting up and calling the contextual help properly, I would not expect the Autodesk help to pop up, or pop up as well, or afterwards, or at all.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You might want to submit a minimal reproducible case to demonstrate that, so we can ask the development team what they think about it, and whether that behaviour is intentional:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this helps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 19:58:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7521444#M55180</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-11-06T19:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: F1 Help for addin only</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7522730#M55181</link>
      <description>&lt;P&gt;Thanks Jeremy, I will put together a sample for the team's testing. Dale&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 07:01:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7522730#M55181</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2017-11-07T07:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: F1 Help for addin only</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7762369#M55182</link>
      <description>&lt;P&gt;Following up on this issue in a new thread:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/contextual-help-not-working-from-within-a-command/m-p/6970171" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/contextual-help-not-working-from-within-a-command/m-p/6970171&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt; &lt;BR /&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 14:28:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7762369#M55182</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-02-08T14:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: F1 Help for addin only</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7848904#M55183</link>
      <description>&lt;P&gt;Solved in the follow-up thread and preserved for posterity by The Building Coder:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2018/03/contextual-help-best-practice.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2018/03/contextual-help-best-practice.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks to Dragos for solving and explaining this there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 11:06:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/f1-help-for-addin-only/m-p/7848904#M55183</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-03-13T11:06:34Z</dc:date>
    </item>
  </channel>
</rss>

