InputBox: System beep when pressing 'Enter' instead of 'OK'.
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)
-
repo owner -
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."
-
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.
-
reporter I still get a system beep.
-
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.
-
reporter Retested, fixed. The InputBox is different than AHK’s, but I like it better.
-
repo owner - changed status to resolved
-
repo owner - changed status to closed
- Log in to comment
I think you forgot to post a snippet. Please post it so I can try to reproduce.