Skip to content

Ding sound when pressing Alt+{key} on Windows #1

@Eneroth3

Description

@Eneroth3

When running a dialog inside of SketchUp and using access keys a ding sound is played. The sound is not played in standalone browsers. The sound is very annoying and indicates some sort of error occured, even though access keys work just fine.

Steps to reproduce:

  1. Create dialog by pasting code below in Ruby console.
  2. Press Alt+Y or Alt+N
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>Is this a rhetorical question?</p>
      <p>(Enter is shortcut for Yes, Esc is shortcut for Cancel)</p>
      <button data-access-key="y" class="dlg-callback-yes">Yes</button>
      <button data-access-key="n" class="dlg-callback-no">No</button>
      <button class="dlg-callback-cancel">Cancel</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("yes")    { puts "Yes" }
dialog.add_action_callback("no")     { puts "No" }
dialog.add_action_callback("cancel") { puts "Cancel" }
dialog.show

Tested in SketchUp 2017 and 2018 on 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