Beispiel #1
0
        // 키코드하나에 키테이블 두개이상 매치가능 있기 떄문에 생성자에만 사용하도록 접근제한자 private로 설정
        private static KeyTable GetKeyTable(int _keycode)
        {
            for (int i = 0; i < KEY_COUNT; i++)
            {
                if (kt[i].KeyCode == _keycode)
                {
                    KeyTable ktResult = new KeyTable(ERROR_INT, ERROR_STR);
                    ktResult.KeyCode = kt[i].KeyCode;
                    ktResult.KeyName = kt[i].KeyName;
                    ktResult.KeyView = kt[i].KeyView;
                    ktResult.Index   = i;
                    return(ktResult);
                }
            }

            return(new KeyTable(ERROR_INT, ERROR_STR, ERROR_STR, ERROR_INT));
        }
Beispiel #2
0
        static KeyModel()
        {
            int _idx         = 0;
            int _num_on_idx  = 0;
            int _num_off_idx = 0;

            // KEYCODE , KEYNAME, KEYVIEW
            kt[_idx++] = new KeyTable(27, "ESC");
            kt[_idx++] = new KeyTable(112, "F1");
            kt[_idx++] = new KeyTable(113, "F2");
            kt[_idx++] = new KeyTable(114, "F3");
            kt[_idx++] = new KeyTable(115, "F4");
            kt[_idx++] = new KeyTable(116, "F5");
            kt[_idx++] = new KeyTable(117, "F6");
            kt[_idx++] = new KeyTable(118, "F7");
            kt[_idx++] = new KeyTable(119, "F8");
            kt[_idx++] = new KeyTable(120, "F9");
            kt[_idx++] = new KeyTable(121, "F10");
            kt[_idx++] = new KeyTable(122, "F11");
            kt[_idx++] = new KeyTable(123, "F12");
            kt[_idx++] = new KeyTable(192, "`");
            kt[_idx++] = new KeyTable(49, "1");
            kt[_idx++] = new KeyTable(50, "2");
            kt[_idx++] = new KeyTable(51, "3");
            kt[_idx++] = new KeyTable(52, "4");
            kt[_idx++] = new KeyTable(53, "5");
            kt[_idx++] = new KeyTable(54, "6");
            kt[_idx++] = new KeyTable(55, "7");
            kt[_idx++] = new KeyTable(56, "8");
            kt[_idx++] = new KeyTable(57, "9");
            kt[_idx++] = new KeyTable(48, "0");
            kt[_idx++] = new KeyTable(189, "-");
            kt[_idx++] = new KeyTable(187, "=");
            kt[_idx++] = new KeyTable(8, "Backspace");
            kt[_idx++] = new KeyTable(9, "Tab");
            kt[_idx++] = new KeyTable(81, "Q", "q");
            kt[_idx++] = new KeyTable(87, "W", "w");
            kt[_idx++] = new KeyTable(69, "E", "e");
            kt[_idx++] = new KeyTable(82, "R", "r");
            kt[_idx++] = new KeyTable(84, "T", "t");
            kt[_idx++] = new KeyTable(89, "Y", "y");
            kt[_idx++] = new KeyTable(85, "U", "u");
            kt[_idx++] = new KeyTable(73, "I", "i");
            kt[_idx++] = new KeyTable(79, "O", "o");
            kt[_idx++] = new KeyTable(80, "P", "p");
            kt[_idx++] = new KeyTable(219, "[");
            kt[_idx++] = new KeyTable(221, "]");
            kt[_idx++] = new KeyTable(220, @"\");
            kt[_idx++] = new KeyTable(20, "CapsLock");
            kt[_idx++] = new KeyTable(65, "A", "a");
            kt[_idx++] = new KeyTable(83, "S", "s");
            kt[_idx++] = new KeyTable(68, "D", "d");
            kt[_idx++] = new KeyTable(70, "F", "f");
            kt[_idx++] = new KeyTable(71, "G", "g");
            kt[_idx++] = new KeyTable(72, "H", "h");
            kt[_idx++] = new KeyTable(74, "J", "j");
            kt[_idx++] = new KeyTable(75, "K", "k");
            kt[_idx++] = new KeyTable(76, "L", "l");
            kt[_idx++] = new KeyTable(186, ";");
            kt[_idx++] = new KeyTable(222, "'");
            kt[_idx++] = new KeyTable(13, "Enter");
            kt[_idx++] = new KeyTable(160, "LShift", "Shift");
            kt[_idx++] = new KeyTable(90, "Z", "z");
            kt[_idx++] = new KeyTable(88, "X", "x");
            kt[_idx++] = new KeyTable(67, "C", "c");
            kt[_idx++] = new KeyTable(86, "V", "v");
            kt[_idx++] = new KeyTable(66, "B", "b");
            kt[_idx++] = new KeyTable(78, "N", "n");
            kt[_idx++] = new KeyTable(77, "M", "m");
            kt[_idx++] = new KeyTable(188, ",");
            kt[_idx++] = new KeyTable(190, ".");
            kt[_idx++] = new KeyTable(191, "/");
            kt[_idx++] = new KeyTable(161, "RShift", "Shift");
            kt[_idx++] = new KeyTable(162, "LCtrl", "Ctrl");
            kt[_idx++] = new KeyTable(91, "LWin", "Win");
            kt[_idx++] = new KeyTable(164, "LAlt", "Alt");
            kt[_idx++] = new KeyTable(32, "Spacebar");
            kt[_idx++] = new KeyTable(21, "RAlt", "Alt");
            kt[_idx++] = new KeyTable(92, "RWin", "Win");
            kt[_idx++] = new KeyTable(93, "Menu");
            kt[_idx++] = new KeyTable(25, "RCtrl", "Ctrl");
            kt[_idx++] = new KeyTable(44, "PrtSc");
            kt[_idx++] = new KeyTable(145, "ScrLk");
            kt[_idx++] = new KeyTable(19, "Pause");
            kt[_idx++] = new KeyTable(45, "Insert", "Ins");
            kt[_idx++] = new KeyTable(36, "Home");
            kt[_idx++] = new KeyTable(33, "PageUp", "Page\nUp");
            kt[_idx++] = new KeyTable(46, "Delete", "Del");
            kt[_idx++] = new KeyTable(35, "End");
            kt[_idx++] = new KeyTable(34, "PageDown", "Page\nDown");
            kt[_idx++] = new KeyTable(38, "↑");
            kt[_idx++] = new KeyTable(37, "←");
            kt[_idx++] = new KeyTable(40, "↓");
            kt[_idx++] = new KeyTable(39, "→");
            kt[_idx++] = new KeyTable(144, "NumLock", "Num\nLock");
            kt[_idx++] = new KeyTable(111, "Num/", "/");
            kt[_idx++] = new KeyTable(106, "Num*", "*");
            kt[_idx++] = new KeyTable(109, "Num-", "-");
            kt[_idx++] = new KeyTable(103, "Num7", "7");
            kt[_idx++] = new KeyTable(104, "Num8", "8");
            kt[_idx++] = new KeyTable(105, "Num9", "9");
            kt[_idx++] = new KeyTable(107, "Num+", "+");
            kt[_idx++] = new KeyTable(100, "Num4", "4");
            kt[_idx++] = new KeyTable(101, "Num5", "5");
            kt[_idx++] = new KeyTable(102, "Num6", "6");
            kt[_idx++] = new KeyTable(97, "Num1", "1");
            kt[_idx++] = new KeyTable(98, "Num2", "2");
            kt[_idx++] = new KeyTable(99, "Num3", "3");
            kt[_idx++] = new KeyTable(13, "Enter");
            kt[_idx++] = new KeyTable(96, "Num0", "0");
            kt[_idx++] = new KeyTable(110, "Num.", ".");
            kt[_idx++] = new KeyTable(12, "CLEAR");

            ktNumOn[_num_on_idx++] = GetKeyTable(103);
            ktNumOn[_num_on_idx++] = GetKeyTable(104);
            ktNumOn[_num_on_idx++] = GetKeyTable(105);
            ktNumOn[_num_on_idx++] = GetKeyTable(100);
            ktNumOn[_num_on_idx++] = GetKeyTable(101);
            ktNumOn[_num_on_idx++] = GetKeyTable(102);
            ktNumOn[_num_on_idx++] = GetKeyTable(97);
            ktNumOn[_num_on_idx++] = GetKeyTable(98);
            ktNumOn[_num_on_idx++] = GetKeyTable(99);
            ktNumOn[_num_on_idx++] = GetKeyTable(96);
            ktNumOn[_num_on_idx++] = GetKeyTable(110);

            ktNumOff[_num_off_idx++] = GetKeyTable(36);
            ktNumOff[_num_off_idx++] = GetKeyTable(38);
            ktNumOff[_num_off_idx++] = GetKeyTable(33);
            ktNumOff[_num_off_idx++] = GetKeyTable(37);
            ktNumOff[_num_off_idx++] = GetKeyTable(12);
            ktNumOff[_num_off_idx++] = GetKeyTable(39);
            ktNumOff[_num_off_idx++] = GetKeyTable(35);
            ktNumOff[_num_off_idx++] = GetKeyTable(40);
            ktNumOff[_num_off_idx++] = GetKeyTable(34);
            ktNumOff[_num_off_idx++] = GetKeyTable(45);
            ktNumOff[_num_off_idx++] = GetKeyTable(46);

            SetCapsIdxArray();
        }