1 Reply Latest reply on Mar 19, 2018 2:41 AM by Francesco Parisi

    Android Xamarin Detect Yellow Button Press

    Francesco Parisi

      Hi,

       

      I want to start activity at the press of the yellow button. For what I see here:

       

      Key detection on form plus making the keyboard disappear on a device with physical keys — Xamarin Forums

       

      https://code.tutsplus.com/tutorials/android-sdk-intercepting-physical-key-events--mobile-10379

       

      I need to use Android.Views.Keycode I'm just wondering what is the keycode of the scanner button.

        • Re: Android Xamarin Detect Yellow Button Press
          Francesco Parisi

          I answer myself

           

                  public override bool OnKeyDown(Android.Views.Keycode keyCode, Android.Views.KeyEvent e)       

                  {            

                    if (keyCode == (Android.Views.Keycode.A | Android.Views.Keycode.TvContentsMenu))           

                    {                

                         if (e.RepeatCount == 0)               

                         {                    

                              StartActivity(typeof(OrdineBarre));               

                         }               

                         return true;            

                    }            

                   return base.OnKeyDown(keyCode, e);        

                 }

           

          the scan button in TC 20 is associated to a combination of key codes.