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


C# KeyInput.Empty方法代码示例

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


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

示例1: DefaultValue


//.........这里部分代码省略.........
            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;
            case CecUserControlCode.ChannelUp:
            case CecUserControlCode.PageUp:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_MEDIA_NEXT_TRACK);
              break;
            case CecUserControlCode.ChannelDown:
            case CecUserControlCode.PageDown:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_MEDIA_PREV_TRACK);
              break;
            case CecUserControlCode.VolumeUp:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_VOLUME_UP);
              break;
            case CecUserControlCode.VolumeDown:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_VOLUME_DOWN);
              break;
            case CecUserControlCode.Mute:
            case CecUserControlCode.MuteFunction:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_VOLUME_MUTE);
              break;
            case CecUserControlCode.Play:
            case CecUserControlCode.PlayFunction:
            case CecUserControlCode.Pause:
            case CecUserControlCode.PausePlayFunction:
            case CecUserControlCode.PauseRecord:
            case CecUserControlCode.PauseRecordFunction:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_MEDIA_PLAY_PAUSE);
              break;
            case CecUserControlCode.Stop:
            case CecUserControlCode.StopFunction:
            case CecUserControlCode.StopRecord:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_MEDIA_STOP);
              break;
            case CecUserControlCode.Rewind:
            case CecUserControlCode.Backward:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_LEFT);
              break;
            case CecUserControlCode.Forward:
            case CecUserControlCode.FastForward:
              keyInput.AddKey(WindowsAPI.VirtualKeyCode.VK_RIGHT);
              break;

            //currently unmapped
            //case CecUserControlCode.NextFavorite:
            //case CecUserControlCode.PreviousChannel:
            //case CecUserControlCode.SoundSelect:
            //case CecUserControlCode.InputSelect:
            //case CecUserControlCode.DisplayInformation:
            //case CecUserControlCode.Help:
            //case CecUserControlCode.Record:
            //case CecUserControlCode.Eject:
            //case CecUserControlCode.Angle:
            //case CecUserControlCode.SubPicture:
            //case CecUserControlCode.VideoOnDemand:
            //case CecUserControlCode.ElectronicProgramGuide:
            //case CecUserControlCode.TimerProgramming:
            //case CecUserControlCode.RecordFunction:
            //case CecUserControlCode.RestoreVolumeFunction:
            //case CecUserControlCode.TuneFunction:
            //case CecUserControlCode.SelectMediaFunction:
            //case CecUserControlCode.SelectAVInputFunction:
            //case CecUserControlCode.SelectAudioInputFunction:
            //case CecUserControlCode.Data:
            //default:
            //  break;
              }

              return keyInput.Empty() ? null : keyInput;
        }
开发者ID:jajoflo,项目名称:libcec,代码行数:101,代码来源:WMCController.cs


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