Skip to content

Pressing F1 opens SketchUp help #2

@Eneroth3

Description

@Eneroth3

In dialogs F1 is the shortcut key for activating the control with the dlg-callback-help class, e.g. a link to a help article. While this works in itself SketchUp also opens the SketchUp help center in a web browser.

Opening 2 help resources may be confusing and prevent the user from finding the relevant help resource. The desired result would be for F1 to not open SketchUp help inside a dialog that has a help control, but only activate the help control of that dialog.

Steps to reproduce:

  1. Run code below.
  2. Press F1
base_dir = UI.select_directory(title: "Locate modules/")
html = <<-HTML
  <!DOCTYPE HTML>
  <html>
    <head>
      <meta charset="UTF-8">
      <base href="#{base_dir}/" />
      <script src="controls.js"></script>
      <script src="jquery-1.12.4.js"></script>
      <script>
        // Initialize the controls when the document is ready.
        $(document).ready(function() {
          Controls();
        } );
      </script>
    </head>
    <body>
      <p>Pressing F1 both activates the button below, and open SketchUp help.</p>
      <button data-access-key="h" class="dlg-callback-help">HELP!</button>
    </body>
  </html>
HTML
dialog = UI::HtmlDialog.new(
  dialog_title: "Dialog Dialog",
  width: 300,
  height: 180
)
dialog.center
dialog.set_html(html)
dialog.add_action_callback("help") { puts "Help" }
dialog.show

Tested on SketchUp 2017 and 18, Win 7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions