InputBox: System beep when pressing 'Enter' instead of 'OK'.

Issue #7 closed
Winter Laite created an issue

Tested using code below, modified from 'a. Getting user input'. With 2.0-beta.6 and 2.0-beta.7, pressing ‘Enter’ after populating InputBox functions as if ‘OK’ were pressed, even if ‘OK’ does not have focus. With keysharp there is a system beep if ‘OK’ does not have focus, but otherwise it give expected results.

Comments (8)

  1. Winter Laite reporter

    Sorry! Here’s what I used.

    OutputVar := InputBox("What is your first name?", "Question 1").Value
    if (OutputVar = "Bill")
        MsgBox("That's an awesome name, " OutputVar ".")
    
    OutputVar2 := InputBox("Do you like AutoHotkey?", "Question 2").Value
    if (OutputVar2 = "yes")
        MsgBox("Thank you for answering " OutputVar2 ", " OutputVar "! We will become great friends.")
    else
        MsgBox(OutputVar ", That makes me sad."
    

  2. Matt Feemster repo owner

    I just ran this and it works fine when pressing enter when the text box has focus. I don’t hear any system beep.

    However, I did notice the positioning of the controls on the input box window is a little off. I will fix it now.

  3. Matt Feemster repo owner

    I figured out why I wasn’t getting the system beep: ever since I installed Windows 98, part of my standard install procedure has been to disable all system sounds. Once I re-enabled them, I got the ding.

    I’ve committed a fix that also includes many other bug fixes for InputBox(). The layout of the window should look much cleaner now. It also supports wordwrapping on the label and properly sizing the controls when you specify a window size.

  4. Log in to comment