コード例 #1
0
        public VKeyboard()
        {
            VirtualKeys = new List <VKey>();

            KeyA           = new VKey(Keys.A); VirtualKeys.Add(KeyA);
            KeyB           = new VKey(Keys.B); VirtualKeys.Add(KeyB);
            KeyC           = new VKey(Keys.C); VirtualKeys.Add(KeyC);
            KeyCTr         = new VKey(Keys.Oem5); VirtualKeys.Add(KeyCTr);
            KeyD           = new VKey(Keys.D); VirtualKeys.Add(KeyD);
            KeyE           = new VKey(Keys.E); VirtualKeys.Add(KeyE);
            KeyF           = new VKey(Keys.F); VirtualKeys.Add(KeyF);
            KeyG           = new VKey(Keys.G); VirtualKeys.Add(KeyG);
            KeyGTr         = new VKey(Keys.Oem4); VirtualKeys.Add(KeyGTr);
            KeyH           = new VKey(Keys.H); VirtualKeys.Add(KeyH);
            KeyI           = new VKey(Keys.I); VirtualKeys.Add(KeyI);
            KeyITr         = new VKey(Keys.Oem7); VirtualKeys.Add(KeyITr);
            KeyJ           = new VKey(Keys.J); VirtualKeys.Add(KeyJ);
            KeyK           = new VKey(Keys.K); VirtualKeys.Add(KeyK);
            KeyL           = new VKey(Keys.L); VirtualKeys.Add(KeyL);
            KeyM           = new VKey(Keys.M); VirtualKeys.Add(KeyM);
            KeyN           = new VKey(Keys.N); VirtualKeys.Add(KeyN);
            KeyO           = new VKey(Keys.O); VirtualKeys.Add(KeyO);
            KeyOTr         = new VKey(Keys.Oem2); VirtualKeys.Add(KeyOTr);
            KeyP           = new VKey(Keys.P); VirtualKeys.Add(KeyP);
            KeyQ           = new VKey(Keys.Q); VirtualKeys.Add(KeyQ);
            KeyR           = new VKey(Keys.R); VirtualKeys.Add(KeyR);
            KeyS           = new VKey(Keys.S); VirtualKeys.Add(KeyS);
            KeySTr         = new VKey(Keys.Oem1); VirtualKeys.Add(KeySTr);
            KeyT           = new VKey(Keys.T); VirtualKeys.Add(KeyT);
            KeyU           = new VKey(Keys.U); VirtualKeys.Add(KeyU);
            KeyUTr         = new VKey(Keys.Oem6); VirtualKeys.Add(KeyUTr);
            KeyV           = new VKey(Keys.V); VirtualKeys.Add(KeyV);
            KeyW           = new VKey(Keys.W); VirtualKeys.Add(KeyW);
            KeyX           = new VKey(Keys.X); VirtualKeys.Add(KeyX);
            KeyY           = new VKey(Keys.Y); VirtualKeys.Add(KeyY);
            KeyZ           = new VKey(Keys.Z); VirtualKeys.Add(KeyZ);
            Key1           = new VKey(Keys.D1); VirtualKeys.Add(Key1);
            Key2           = new VKey(Keys.D2); VirtualKeys.Add(Key2);
            Key3           = new VKey(Keys.D3); VirtualKeys.Add(Key3);
            Key4           = new VKey(Keys.D4); VirtualKeys.Add(Key4);
            Key5           = new VKey(Keys.D5); VirtualKeys.Add(Key5);
            Key6           = new VKey(Keys.D6); VirtualKeys.Add(Key6);
            Key7           = new VKey(Keys.D7); VirtualKeys.Add(Key7);
            Key8           = new VKey(Keys.D8); VirtualKeys.Add(Key8);
            Key9           = new VKey(Keys.D9); VirtualKeys.Add(Key9);
            Key0           = new VKey(Keys.D0); VirtualKeys.Add(Key0);
            KeyDoubleQuote = new VKey(Keys.Oem3); VirtualKeys.Add(KeyDoubleQuote);
            KeyTab         = new VKey("Tab", "Tab", Keys.Tab); VirtualKeys.Add(KeyTab);
            KeyCaps        = new VKey("Caps", "Caps", Keys.Capital); VirtualKeys.Add(KeyCaps);
            KeyShift       = new VKey("Shift", "Shift", Keys.Shift); VirtualKeys.Add(KeyShift);
            KeyStar        = new VKey(Keys.Oem8); VirtualKeys.Add(KeyStar);
            KeyDash        = new VKey(Keys.OemMinus); VirtualKeys.Add(KeyDash);
            KeyBack        = new VKey("BackSpace", "BackSpace", Keys.Back); VirtualKeys.Add(KeyBack);
            KeyEnter       = new VKey("Enter", "Enter", Keys.Enter); VirtualKeys.Add(KeyEnter);
            KeyComma       = new VKey(Keys.Oemcomma); VirtualKeys.Add(KeyComma);
            KeyPoint       = new VKey(Keys.OemPeriod); VirtualKeys.Add(KeyPoint);
            KeyAt          = new VKey("@", "€", Keys.Oem102); VirtualKeys.Add(KeyAt);
            KeySpace       = new VKey(" ", "Space", Keys.Space); VirtualKeys.Add(KeySpace);
            UpArrow        = new VKey("Up", "Up", Keys.Up); VirtualKeys.Add(UpArrow);
            DownArrow      = new VKey("Down", "Down", Keys.Down); VirtualKeys.Add(DownArrow);
        }
コード例 #2
0
 private void OnKeyPress(VKey obj)
 {
     Model.ProcessKey(obj.VirtualKey);
 }