Exemple #1
0
        void rc_Data(RemoteControl.Key key)
        {
            Keys k = Keys.None;
            Form.Invoke((MethodInvoker)delegate
            {
                switch (key)
                {
                    case RemoteControl.Key.rckChannelDown:
                        k = Keys.Down;
                        break;
                    case RemoteControl.Key.rckChannelUp:
                        k = Keys.Up;
                        break;
                    case RemoteControl.Key.rckVolUp:
                        k = Keys.Add;
                        break;
                    case RemoteControl.Key.rckVolDown:
                        k = Keys.Subtract;
                        break;
                    case RemoteControl.Key.rckMute:
                        k = Keys.M;
                        break;
                    case RemoteControl.Key.rckShutDown:
                        Form.Close();
                        return;
                    case RemoteControl.Key.rckFullScreen:
                        k = Keys.Enter;
                        break;
                    case RemoteControl.Key.rck0:
                        k = Keys.D0;
                        break;
                    case RemoteControl.Key.rck1:
                        k = Keys.D1;
                        break;
                    case RemoteControl.Key.rck2:
                        k = Keys.D2;
                        break;
                    case RemoteControl.Key.rck3:
                        k = Keys.D3;
                        break;
                    case RemoteControl.Key.rck4:
                        k = Keys.D4;
                        break;
                    case RemoteControl.Key.rck5:
                        k = Keys.D5;
                        break;
                    case RemoteControl.Key.rck6:
                        k = Keys.D6;
                        break;
                    case RemoteControl.Key.rck7:
                        k = Keys.D7;
                        break;
                    case RemoteControl.Key.rck8:
                        k = Keys.D8;
                        break;
                    case RemoteControl.Key.rck9:
                        k = Keys.D9;
                        break;
                    case RemoteControl.Key.rckReturn:
                        k = Keys.R;
                        break;
                }

                Form_KeyDown(this, new KeyEventArgs(k));
            });
        }
Exemple #2
0
 protected void OnDataEvent(RemoteControl.Key key)
 {
     if (Data != null)
         Data(key);
 }