예제 #1
0
 /// <returns>
 ///		対応する値がなければ System.Windows.Forms.Keys.None を返す。
 /// </returns>
 public static WindowsKey KeyToKeys(SlimDXKey key)
 {
     if (_KeyToKeys.ContainsKey(key))
     {
         return(_KeyToKeys[key]);
     }
     else
     {
         return(WindowsKey.None);
     }
 }
예제 #2
0
        // メソッド
        public static Keys KeyToKeyCode(SlimDXKey key)
        {
            switch (key)
            {
            case Key.D0:
                return(Keys.D0);

            case Key.D1:
                return(Keys.D1);

            case Key.D2:
                return(Keys.D2);

            case Key.D3:
                return(Keys.D3);

            case Key.D4:
                return(Keys.D4);

            case Key.D5:
                return(Keys.D5);

            case Key.D6:
                return(Keys.D6);

            case Key.D7:
                return(Keys.D7);

            case Key.D8:
                return(Keys.D8);

            case Key.D9:
                return(Keys.D9);

            case Key.A:
                return(Keys.A);

            case Key.B:
                return(Keys.B);

            case Key.C:
                return(Keys.C);

            case Key.D:
                return(Keys.D);

            case Key.E:
                return(Keys.E);

            case Key.F:
                return(Keys.F);

            case Key.G:
                return(Keys.G);

            case Key.H:
                return(Keys.H);

            case Key.I:
                return(Keys.I);

            case Key.J:
                return(Keys.J);

            case Key.K:
                return(Keys.K);

            case Key.L:
                return(Keys.L);

            case Key.M:
                return(Keys.M);

            case Key.N:
                return(Keys.N);

            case Key.O:
                return(Keys.O);

            case Key.P:
                return(Keys.P);

            case Key.Q:
                return(Keys.Q);

            case Key.R:
                return(Keys.R);

            case Key.S:
                return(Keys.S);

            case Key.T:
                return(Keys.T);

            case Key.U:
                return(Keys.U);

            case Key.V:
                return(Keys.V);

            case Key.W:
                return(Keys.W);

            case Key.X:
                return(Keys.X);

            case Key.Y:
                return(Keys.Y);

            case Key.Z:
                return(Keys.Z);

//				case Key.AbntC1:
//					return Keys.A; //0x73;
            //147
//				case Key.AbntC2:
//					return Keys.A; //0x7e;

//				case Key.Apostrophe:
//					return Keys.A;			///

            case Key.Applications:
                return(Keys.Apps);

            case Key.AT:
                return(Keys.Oem3);

//				case Key.AX:
//					return Keys.A;			///

            case Key.Backspace:
                return(Keys.Back);

            case Key.Backslash:
                return(Keys.Oem5);

//				case Key.Calculator:
//					return Keys.A;			///

            case Key.CapsLock:
                return(Keys.CapsLock);

            case Key.Colon:
                return(Keys.Oem1);

            case Key.Comma:
                return(Keys.Oemcomma);

            case Key.Convert:
                return(Keys.IMEConvert);

            case Key.Delete:
                return(Keys.Delete);

            case Key.DownArrow:
                return(Keys.Down);

            case Key.End:
                return(Keys.End);

            case Key.Equals:
                return(Keys.A);                                         ///

            case Key.Escape:
                return(Keys.Escape);

            case Key.F1:
                return(Keys.F1);

            case Key.F2:
                return(Keys.F2);

            case Key.F3:
                return(Keys.F3);

            case Key.F4:
                return(Keys.F4);

            case Key.F5:
                return(Keys.F5);

            case Key.F6:
                return(Keys.F6);

            case Key.F7:
                return(Keys.F7);

            case Key.F8:
                return(Keys.F8);

            case Key.F9:
                return(Keys.F9);

            case Key.F10:
                return(Keys.F10);

            case Key.F11:
                return(Keys.F11);

            case Key.F12:
                return(Keys.F12);

            case Key.F13:
                return(Keys.F13);

            case Key.F14:
                return(Keys.F14);

            case Key.F15:
                return(Keys.F15);

            case Key.Grave:
                return(Keys.A);                                         ///

            case Key.Home:
                return(Keys.Home);

            case Key.Insert:
                return(Keys.Insert);

            case Key.Kana:
                return(Keys.KanaMode);

            case Key.Kanji:
                return(Keys.KanjiMode);

            case Key.LeftBracket:
                return(Keys.Oem4);

            case Key.LeftControl:
                return(Keys.LControlKey);

            case Key.LeftArrow:
                return(Keys.Left);

            case Key.LeftAlt:
                return(Keys.LMenu);

            case Key.LeftShift:
                return(Keys.LShiftKey);

            case Key.LeftWindowsKey:
                return(Keys.LWin);

            case Key.Mail:
                return(Keys.LaunchMail);

            case Key.MediaSelect:
                return(Keys.SelectMedia);

            case Key.MediaStop:
                return(Keys.MediaStop);

            case Key.Minus:
                return(Keys.OemMinus);

            case Key.Mute:
                return(Keys.VolumeMute);

            case Key.MyComputer:                                        ///
                return(Keys.A);

            case Key.NextTrack:
                return(Keys.MediaNextTrack);

            case Key.NoConvert:
                return(Keys.IMENonconvert);

            case Key.NumberLock:
                return(Keys.NumLock);

            case Key.NumberPad0:
                return(Keys.NumPad0);

            case Key.NumberPad1:
                return(Keys.NumPad1);

            case Key.NumberPad2:
                return(Keys.NumPad2);

            case Key.NumberPad3:
                return(Keys.NumPad3);

            case Key.NumberPad4:
                return(Keys.NumPad4);

            case Key.NumberPad5:
                return(Keys.NumPad5);

            case Key.NumberPad6:
                return(Keys.NumPad6);

            case Key.NumberPad7:
                return(Keys.NumPad7);

            case Key.NumberPad8:
                return(Keys.NumPad8);

            case Key.NumberPad9:
                return(Keys.NumPad9);

            case Key.NumberPadComma:
                return(Keys.Separator);

            case Key.NumberPadEnter:
                return(Keys.A);                                                 //

            case Key.NumberPadEquals:
                return(Keys.A);                                                 //

            case Key.NumberPadMinus:
                return(Keys.Subtract);

            case Key.NumberPadPeriod:
                return(Keys.Decimal);

            case Key.NumberPadPlus:
                return(Keys.Add);

            case Key.NumberPadSlash:
                return(Keys.Divide);

            case Key.NumberPadStar:
                return(Keys.Multiply);                                  //

            case Key.Oem102:
                return(Keys.Oem102);

            case Key.PageDown:
                return(Keys.PageDown);

            case Key.PageUp:
                return(Keys.PageUp);

            case Key.Pause:
                return(Keys.Pause);

            case Key.Period:
                return(Keys.OemPeriod);

            case Key.PlayPause:
                return(Keys.MediaPlayPause);

            case Key.Power:
                return(Keys.A);                                                 ///

            case Key.PreviousTrack:
                return(Keys.MediaPreviousTrack);

            case Key.RightBracket:
                return(Keys.Oem6);

            case Key.RightControl:
                return(Keys.RControlKey);

            case Key.Return:
                return(Keys.Return);

            case Key.RightArrow:
                return(Keys.Right);

            case Key.RightAlt:
                return(Keys.RMenu);

            case Key.RightShift:
                return(Keys.A);

            case Key.RightWindowsKey:
                return(Keys.RWin);

            case Key.ScrollLock:
                return(Keys.Scroll);

            case Key.Semicolon:
                return(Keys.Oemplus);                                   ///??

            case Key.Slash:
                return(Keys.Oem2);

            case Key.Sleep:
                return(Keys.Sleep);

            case Key.Space:
                return(Keys.Space);

            case Key.Stop:
                return(Keys.MediaStop);

            case Key.PrintScreen:
                return(Keys.PrintScreen);

            case Key.Tab:
                return(Keys.Tab);

            case Key.Underline:
                return(Keys.Oem102);

//				case Key.Unlabeled:				///
//					return Keys.A;

            case Key.UpArrow:
                return(Keys.Up);

            case Key.VolumeDown:
                return(Keys.VolumeDown);

            case Key.VolumeUp:
                return(Keys.VolumeUp);

            case Key.Wake:
                return(Keys.A);                                                 ///

            case Key.WebBack:
                return(Keys.BrowserBack);

            case Key.WebFavorites:
                return(Keys.BrowserFavorites);

            case Key.WebForward:
                return(Keys.BrowserForward);

            case Key.WebHome:
                return(Keys.BrowserHome);

            case Key.WebRefresh:
                return(Keys.BrowserRefresh);

            case Key.WebSearch:
                return(Keys.BrowserSearch);

            case Key.WebStop:
                return(Keys.BrowserStop);

            case Key.Yen:
                return(Keys.OemBackslash);
            }
            return(0);
        }