Skip to content

add selectCmdLine function #5277

@Kebap

Description

@Kebap

Brief summary of issue / Description of requested feature:

New function selectCmdLine to select all current text in command line

Steps to reproduce the issue / Reasons for adding feature:

  1. When you type text in command line and send to the game, the text in command line stays selected
  2. At this time, you can either modify the text, or delete it, or press enter to send again, or start typing to overwrite
  3. However, if you put text to command line via printCmdLine() the text is not selected and none of 2. possible

Error output / Expected result of feature

Actions from point 2. should become possible as well with this new function

Extra information, such as Mudlet version, operating system and ideas for how to solve / implement:

Requested by Brewer@MG

You can test this easily by typing the following in command line:
lua tempTimer(1, function() printCmdLine("test") end)
Then after sending the line, immediately delete (the still selected) text from command line.
After 1s, the "test" text will be added to command line, and indeed not be selected at all.

However, if you were to test with only lua printCmdLine("test") instead then the result may be confusing.
Because the command line will not show this previously sent lua command anymore but "test" alright, but this is now still selected for some reason.
Could be argued it should drop the selected status if the contents got modified by script, but who am I to say.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions