Hi everyone this my first post I hope helps someone. I was looking ways for catching keypress from a textfield and I found the methods a little bit complicated, but I found a thread(http://forums.ext.net/showthread.php...-on-codebehind) that was missing just a little thing to works fine
the initial code was:
designer page:
<ext:TextField runat="server" ID="txtProdutoCodigo" Width="100" EnableKeyEvents="true">
<DirectEvents>
<KeyUp OnEvent="txtProdutoCodigoKeyPress">
<ExtraParams>
<ext:Parameter Name="key" Value="{what I have to put here to get the key pressed?}" Mode="Raw">
</ext:Parameter>
</ExtraParams>
</KeyUp>
</DirectEvents>
</ext:TextField>
<ext:TextField runat="server" ID="txtProdutoDescricao" Width="340">
</ext:TextField>
code behind:
protected void txtProdutoCodigoKeyPress(object sender, DirectEventArgs e)
{
KeyCode kcode;
try
{
kcode = (KeyCode)Enum.Parse(typeof(KeyCode), e.ExtraParams["key"]);
if (kcode == KeyCode.ENTER)
{ }
}
catch { }
}
And my changes are:
designer side:
<ext:TextField ID="TextField1" runat="server" EnableKeyEvents="true">
                                <DirectEvents>
                                    <KeyUp OnEvent="loginkeypress">
                                        <ExtraParams>
                                            <ext:Parameter Name="tecla" Value="e.getKey()" Mode="Raw">
                                            </ext:Parameter>
                                        </ExtraParams>
                                    </KeyUp>
                                </DirectEvents>
</ext:TextField>
code behind:
protected void loginkeypress(Object sender, Ext.Net.DirectEventArgs e)
    {
        Ext.Net.KeyCode tecla = new Ext.Net.KeyCode();
        try
        {
            tecla = (Ext.Net.KeyCode)Enum.Parse(typeof(Ext.Net.KeyCode), e.ExtraParams["tecla"]);
            if (tecla == Ext.Net.KeyCode.ENTER)
            {
                //code you want to execute
            }
        }
        catch(Exception ex)
        { }
     }

the id's and the names of the functions are up to you the interesting thing is the value of parameter in textfield1('e.getKey()') which alow us to know what key was pressed or up or down that is also up to you I mean the event you want to listen or wait to be triggered this was the easier way I found hope it helps bye.