Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Detecting KeyDown in an entry?

$
0
0

Hi,

I'd like to detect when the backspace keyboard button is pressed in an Entry even when there is no text in the entry. I've tried creating a custom renderer and overriding OnKeyDown but it doesn't seem to do anything. In my custom android renderer that extends Entry:

public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
{
    Console.WriteLine("A key was pressed");
    if (keyCode == Keycode.Del)
    {
        // do stuff here
    }
    return base.OnKeyDown(keyCode, e);
}

Unfortunately this doesn't seem to do anything. How can I achieve this?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>