Skip to content

Application.Driver.SendKeys should be retired #4025

@tznind

Description

@tznind

Is your feature request related to a problem? Please describe.

This method is problematic for 2 reasons:

  • It assumes that all drivers operate on char and/or ConsoleKey
  • It requires/assumes that the user knows what combination of keyChar and ConsoleKey describe a given key press

The actual raw inputs are:

Driver Class
Win InputRecord (and KeyEventRecord)
Net ConsoleKeyInfo

Furthermore this method is not implemented in v2 drivers. See ConsoleDriverFacade:

public void SendKeys (char keyChar, ConsoleKey key, bool shift, bool alt, bool ctrl)
{
    // TODO: implement
}

Finally if we were to have a shared implementation of spawning keystrokes - then it should be the class that is used within Terminal.Gui itself to represent key presses in driver agnostic way, specifically:

 class Key : EventArgs, IEquatable<Key>

Describe the solution you'd like
Mark obsolete or internal or remove

Describe alternatives you've considered
or internal or remove

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeFor PRs that introduces a breaking change (behavior or API)

    Type

    Projects

    Status

    ✅ Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions