Android Xamarin Detect Yellow Button Press

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.

Francesco Parisi
I answer myself        public

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.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Topic locked