ID:2548220
 
Resolved
From the depths of time: Finally, pressing the escape key in an input() box that allows "null|anything" will cancel the input instead of forcing you to press Cancel.
BYOND Version:512
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 80.0.3987.122
Applies to:Dream Seeker
Status: Resolved (513.1514)

This issue has been resolved.
Descriptive Problem Summary:

When getting input from the player using a verb, you can cancel the window by pressing the escape key instead of having to click the cancel button. However, it appears that explicit calls to the input proc do not allow for this feature, which appears to be unintended. Examples are below.

I discovered this when editing two separate Space Station 13 codebases, one of which uses verbs and the other uses input. (Please excuse the poor editing skills on the below videos)

This is the server that uses the input procs that do not allow for escape: https://youtu.be/pS531kYS9GY

This is the server that uses verbs that do allow for escape: https://youtu.be/S7lc39Dv7Hk

Numbered Steps to Reproduce Problem:

1. Create a game that asks you for input using both methods.

2. When using the verb, you can cancel it with escape.

3. When using the input proc, you cannot cancel it with escape.

Code Snippet (if applicable) to Reproduce Problem:
//These are examples, actual implementation can vary

//Input proc
var/message = input("","say (text)") as text|null

//Verb
/mob/verb/say_verb(message as text)


Expected Results:

Using the input proc would allow for the window to be closed with the escape key just like using a verb.

Actual Results:

The escape key will not close an input window generated with the input proc.

Does the problem occur:
Every time? Or how often?
Every time you use the relevant proc/verb.
In other games?
Assumably so.
In other user accounts?
Yes.
On other computers?
Yes.

When does the problem NOT occur?

Only if you substitute the input proc for a verb.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Unknown when exactly it started (probably when DM was created given it's a code issue), but both code bases have been around for several years and this has been the same way.

Workarounds:

Substituting the input proc for a verb will, of course, alleviate the issue. However, this shouldn't have to happen.
as text|null
You indicate here for input that you okay with 'null' value. Try same types for verb.
In response to VolAs
VolAs wrote:
as text|null
You indicate here for input that you okay with 'null' value. Try same types for verb.

The problem is the other way around.

Verbs are always cancellable with Escape.

input() calls, even |null ones which have "Cancel" buttons, have no reaction to the Escape key.
Lummox JR resolved issue with message:
From the depths of time: Finally, pressing the escape key in an input() box that allows "null|anything" will cancel the input instead of forcing you to press Cancel.
In response to Lummox JR