当前位置: 首页>>代码示例>>C#>>正文


C# KeyInput.AddKey方法代码示例

本文整理汇总了C#中KeyInput.AddKey方法的典型用法代码示例。如果您正苦于以下问题:C# KeyInput.AddKey方法的具体用法?C# KeyInput.AddKey怎么用?C# KeyInput.AddKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KeyInput的用法示例。


在下文中一共展示了KeyInput.AddKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DefaultValue

        public override ApplicationAction DefaultValue(CecKeypress key)
        {
            KeyInput keyInput = new KeyInput(null);
              switch (key.Keycode)
              {
            case CecUserControlCode.RightUp:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_RIGHT);
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_UP);
              break;
            case CecUserControlCode.LeftUp:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_LEFT);
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_UP);
              break;
            case CecUserControlCode.Up:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_UP);
              break;
            case CecUserControlCode.RightDown:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_RIGHT);
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_DOWN);
              break;
            case CecUserControlCode.LeftDown:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_LEFT);
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_DOWN);
              break;
            case CecUserControlCode.Down:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_DOWN);
              break;
            case CecUserControlCode.Left:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_LEFT);
              break;
            case CecUserControlCode.Right:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_RIGHT);
              break;
            case CecUserControlCode.Select:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_RETURN);
              break;
            case CecUserControlCode.Exit:
            case CecUserControlCode.SamsungReturn:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_BACK);
              break;
            case CecUserControlCode.RootMenu:
            case CecUserControlCode.SetupMenu:
            case CecUserControlCode.ContentsMenu:
            case CecUserControlCode.FavoriteMenu:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_MENU);
              break;
            case CecUserControlCode.Number0:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD0);
              break;
            case CecUserControlCode.Number1:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD1);
              break;
            case CecUserControlCode.Number2:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD2);
              break;
            case CecUserControlCode.Number3:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD3);
              break;
            case CecUserControlCode.Number4:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD4);
              break;
            case CecUserControlCode.Number5:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD5);
              break;
            case CecUserControlCode.Number6:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD6);
              break;
            case CecUserControlCode.Number7:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD7);
              break;
            case CecUserControlCode.Number8:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD8);
              break;
            case CecUserControlCode.Number9:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_NUMPAD9);
              break;
            case CecUserControlCode.Dot:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_SELECT);
              break;
            case CecUserControlCode.Enter:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_RETURN);
              break;
            case CecUserControlCode.Clear:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_CLEAR);
              break;
            case CecUserControlCode.F1Blue:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_F1);
              break;
            case CecUserControlCode.F2Red:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_F2);
              break;
            case CecUserControlCode.F3Green:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_F3);
              break;
            case CecUserControlCode.F4Yellow:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_F4);
              break;
            case CecUserControlCode.F5:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_F5);
              break;
//.........这里部分代码省略.........
开发者ID:jajoflo,项目名称:libcec,代码行数:101,代码来源:WMCController.cs


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