• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Keycode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Keycode的典型用法代码示例。如果您正苦于以下问题:C# Keycode类的具体用法?C# Keycode怎么用?C# Keycode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Keycode类属于命名空间,在下文中一共展示了Keycode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnKey

 public bool OnKey(View v, Keycode keyCode, KeyEvent e)
 {
     if (e.KeyCode == Keycode.Enter && e.Action == 0) {
         activity.EnterKeyPressed ();
     }
     return false;
 }
开发者ID:jkstrawn,项目名称:wanikani_android,代码行数:7,代码来源:KeyListeners.cs


示例2: OrdinalValue

		public static int OrdinalValue(Keycode key)
		{
			if (key == BUTTON_A) {
				return 0;
			} else if (key == BUTTON_B) {
				return 1;
			} else if (key == BUTTON_X) {
				return 2;
			} else if (key == BUTTON_Y) {
				return 3;
			} else if (key == BUTTON_L1) {
				return 4;
			} else if (key == BUTTON_R1) {
				return 5;
			} else if (key == BUTTON_L2) {
				return 6;
			} else if (key == BUTTON_R2) {
				return 7;
			} else if (key == BUTTON_SELECT) {
				return 8;
			} else if (key == BUTTON_START) {
				return 9;
			} else if (key == BUTTON_THUMBL) {
				return 10;
			} else if (key == BUTTON_THUMBR) {
				return 11;
			} else if (key == BACK) {
				return 12;
			} else if (key == POWER) {
				return 13;
			} else {
				return -1;
			}

		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:35,代码来源:ButtonMapping.cs


示例3: OnKeyUp

 public override bool OnKeyUp(Keycode keyCode, KeyEvent keyEvent)
 {
     //Log.Info(TAG, "OnKeyUp=" + (int)keyCode);
     int playerNum = OuyaController.getPlayerNumByDeviceId(keyEvent.DeviceId);
     if (playerNum >= 0 && playerNum < 4)
     {
         if ((int)keyCode == OuyaController.BUTTON_DPAD_DOWN)
         {
             _game.GetFocusManager().FocusDown();
         }
         if ((int)keyCode == OuyaController.BUTTON_DPAD_LEFT)
         {
             _game.GetFocusManager().FocusLeft();
         }
         if ((int)keyCode == OuyaController.BUTTON_DPAD_RIGHT)
         {
             _game.GetFocusManager().FocusRight();
         }
         if ((int)keyCode == OuyaController.BUTTON_DPAD_UP)
         {
             _game.GetFocusManager().FocusUp();
         }
         if ((int)keyCode == OuyaController.BUTTON_O)
         {
             _game.GetFocusManager().InvokeClick();
         }
         if ((int)keyCode == OuyaController.BUTTON_A)
         {
             _game.Exit();
         }
     }
     return true;
 }
开发者ID:BattleJenkins,项目名称:ouya-sdk-examples,代码行数:33,代码来源:Activity1.cs


示例4: OnKeyUp

 public override bool OnKeyUp(Keycode keyCode, KeyEvent e)
 {
     if (keyCode == Keycode.Back)
         return base.OnKeyUp (keyCode, e);
     else
         return jetboy_thread.DoKeyUp (keyCode, e);
 }
开发者ID:rudini,项目名称:monodroid-samples,代码行数:7,代码来源:JetBoyActivity.cs


示例5: keypress

        public bool keypress(Keycode keyCode)
        {
            if (keyCode == Keycode.DpadUp || keyCode == Keycode.VolumeUp) {
                if (mode == GameMode.Ready | mode == GameMode.Lost) {

                    InitNewGame ();

                    SetMode (GameMode.Running);
                    Update ();

                    return true;
                }

                if (mode == GameMode.Paused) {

                    SetMode (GameMode.Running);
                    Update ();

                    return true;
                }

                if (keyCode == Keycode.VolumeUp) {
                    mSig_Direccion = (Direccion) (((int)mDireccion + 1) % 4);
                } else {
                    if (mDireccion != Direccion.Abajo)
                        mSig_Direccion = Direccion.Arriba;
                }

                return true;
            }

            if (keyCode == Keycode.DpadDown) {
                if (mDireccion != Direccion.Arriba)
                    mSig_Direccion = Direccion.Abajo;

                return true;
            }

            if (keyCode == Keycode.VolumeDown) {
                mSig_Direccion = (Direccion) (((int)mDireccion - 1) % 4);

                return true;
            }

            if (keyCode == Keycode.DpadLeft) {
                if (mDireccion != Direccion.Derecha)
                    mSig_Direccion = Direccion.Izquierda;

                return true;
            }

            if (keyCode == Keycode.DpadRight) {
                if (mDireccion != Direccion.Izquierda)
                    mSig_Direccion = Direccion.Derecha;

                return (true);
            }
            return (true);
        }
开发者ID:Hackemate,项目名称:Snake,代码行数:59,代码来源:GameView.cs


示例6: OnKeyDown

        // If Back button is pressed, return previous fragment.
        public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
        {
            if (keyCode == Keycode.Back) {
                return PopFragment();
            }

            return base.OnKeyDown(keyCode, e);
        }
开发者ID:sloscialo,项目名称:EllipticalWorkout,代码行数:9,代码来源:ActivityBase.cs


示例7: OnKeyDown

        public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
        {
            if (keyCode == Keycode.Back) {

                Finish ();
            }
            return base.OnKeyDown (keyCode, e);
        }
开发者ID:WenF,项目名称:SSCA_FlagThis,代码行数:8,代码来源:MessageActivity.cs


示例8: OnKeyUp

 public bool OnKeyUp(Keycode keycode, KeyEvent keyEvent)
 {
     if (keycode == Keycode.Back && _slidingMenu.IsMenuShowing)
     {
         ShowContent();
         return true;
     }
     return false;
 }
开发者ID:bobRafat,项目名称:vvchart,代码行数:9,代码来源:SlidingActivityHelper.cs


示例9: KeyUp

 internal static void KeyUp(Keycode keyCode)
 {
     Keys key;
     if (KeyMap.TryGetValue(keyCode, out key))
     {
         if (keys.Contains(key))
             keys.Remove(key);
     }
 }
开发者ID:Boerlam001,项目名称:MonoGame,代码行数:9,代码来源:Keyboard.cs


示例10: OnKeyDown

        public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
        {
            if (keyCode == Keycode.Back && WaveServices.Platform != null)
            {
                WaveServices.Platform.Exit();
            }

            return base.OnKeyDown(keyCode, e);
        }
开发者ID:123asd123A,项目名称:Samples,代码行数:9,代码来源:App.cs


示例11:

			bool View.IOnKeyListener.OnKey (View v, Keycode keyCode, KeyEvent e)
			{
				if (e.Action == KeyEventActions.Down && keyCode == Keycode.Enter) {
					Logger.Debug ("entered pressed");
					OnSend ();
					return true;
				}
				return false;
			}
开发者ID:SeanmanX,项目名称:opandroid,代码行数:9,代码来源:ChatActivity.cs


示例12: KeyDown

 internal static void KeyDown(Keycode keyCode)
 {
     Keys key;
     if (KeyMap.TryGetValue(keyCode, out key))
     {
         if (!keys.Contains(key))
             keys.Add(key);
     }
 }
开发者ID:Boerlam001,项目名称:MonoGame,代码行数:9,代码来源:Keyboard.cs


示例13: OnKeyDown

        public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
        {
            if (keyCode == Keycode.Menu) {
                StartActivity (typeof(SettingsActivity));
                return true;
            }

            return base.OnKeyDown (keyCode, e);
        }
开发者ID:Redth,项目名称:FlamedTVLauncher,代码行数:9,代码来源:MainActivity.cs


示例14: OnKeyDown

		public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
		{
			if (keyCode == Keycode.Back) {
				oauthWebView.close (true);
				return true;
			} else {
				return base.OnKeyDown (keyCode, e);
			}
		}
开发者ID:secondsun,项目名称:fh-dotnet-sdk,代码行数:9,代码来源:FHOAuthIntent.cs


示例15: OnKeyUp

 public override bool OnKeyUp(Keycode keyCode, KeyEvent e)
 {
     if (keyCode == Keycode.Back)
     {
         WaveEngine.Adapter.Input.InputManager inputManager = (WaveEngine.Adapter.Input.InputManager)adapter.InputManager;
         inputManager.GamePadState.Buttons.Back = ButtonState.Release;
     }
     return true;
 }
开发者ID:noatom,项目名称:Samples,代码行数:9,代码来源:GLView.cs


示例16: OnKeyUp

		public override bool OnKeyUp (Keycode keyCode, KeyEvent e)
		{
			if (keyCode == Keycode.Back) {
				Intent intent = new Intent(Intent.ActionMain);
				intent.AddCategory(Intent.CategoryHome);
				intent.SetFlags(ActivityFlags.NewTask);
				StartActivity(intent);
			}
			return true;
		}
开发者ID:borain89vn,项目名称:demo2,代码行数:10,代码来源:MyProfileActivity.cs


示例17: OnKeyUp

        public override bool OnKeyUp(Keycode keyCode, KeyEvent e)
        {
            if (keyCode == Keycode.Back)
            {
                webView.ClearCache(true);
                Finish();
            }

            return base.OnKeyUp (keyCode, e);
        }
开发者ID:00091701,项目名称:FullscreenPresentation-Mono,代码行数:10,代码来源:BrowserActivity.cs


示例18: OnKeyPreIme

		public override bool OnKeyPreIme(Keycode keyCode, KeyEvent e)
		{
			if (keyCode == Keycode.Back && e.Action == KeyEventActions.Down)
			{
				EventHandler handler = OnKeyboardBackPressed;
				if (handler != null)
					handler(this, EventArgs.Empty);
			}
			return base.OnKeyPreIme(keyCode, e);
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:10,代码来源:EntryEditText.cs


示例19: OnKey

        public bool OnKey(View v, Keycode keyCode, KeyEvent e)
        {
            EditText barcode = (EditText)v;
            if (keyCode == Keycode.Enter||e.KeyCode== Keycode.NumpadEnter) {
                Txtbarcode_AfterTextChanged (barcode);
                return true;
            }

            //barcode.Text = barcode.Text + keyCode;
            return false;
        }
开发者ID:mokth,项目名称:merpV3,代码行数:11,代码来源:EntryActivity.cs


示例20: OnKeyUp

        public override bool OnKeyUp(Keycode keyCode, KeyEvent e)
        {
            if (keyCode == Keycode.Back || e.KeyCode == Keycode.Back)
            {
                var activity = this.Context as Activity;

                activity.FragmentManager.PopBackStack();
            }

            return true;
        }
开发者ID:jbravobr,项目名称:Mais-XamForms,代码行数:11,代码来源:VideoPage.cs



注:本文中的Keycode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Keyframe类代码示例发布时间:2022-05-24
下一篇:
C# KeyboardState类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap