Gui.cs: TextField key events are not working

Created on 24 Jun 2020  路  4Comments  路  Source: migueldeicaza/gui.cs

TextField input = new TextField
{
    X = 0,
    Y = Pos.Bottom(chat) + 1,
    Width = Dim.Fill(),

    ColorScheme = new ColorScheme
    {
        Normal = Terminal.Gui.Attribute.Make(Color.Black, Color.White),
        Focus = Terminal.Gui.Attribute.Make(Color.Black, Color.White),
    },
};

input.KeyDown += Input_KeyDown;
static void Input_KeyDown(View.KeyEventEventArgs e)
{
    // not called when I write to TextField
}
bug

Most helpful comment

I wonder if View.HasFocus could be used for this...

All 4 comments

It's a bug. Do you have any fix? If you haven't I'll try to fixit.

I have not attempted to fix it myself.

That almost works but will now trigger key events even if View is not focused.

I wonder if View.HasFocus could be used for this...

Was this page helpful?
0 / 5 - 0 ratings