KeyMapEditor.java
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13: package xeij;
14:
15: import java.awt.*;
16: import java.awt.event.*;
17: import java.awt.im.*;
18: import java.io.*;
19: import java.util.*;
20: import javax.swing.*;
21:
22: public class KeyMapEditor implements KeyListener {
23:
24:
25: public static final Font FONT = new Font ("SansSerif", Font.PLAIN, 12);
26: public static final int LABEL_HEIGHT = 14;
27: public static final int COL_WIDTH = 14;
28: public static final int ROW_HEIGHT = 18;
29: public static final int COLS = 94;
30: public static final int ROWS = 25;
31: public static final int PADDING_TOP = 10;
32: public static final int PADDING_BOTTOM = 10;
33: public static final int PADDING_LEFT = 10;
34: public static final int PADDING_RIGHT = 10;
35: public static final int KEYBOARD_WIDTH = PADDING_LEFT + COL_WIDTH * COLS + PADDING_RIGHT;
36: public static final int KEYBOARD_HEIGHT = PADDING_TOP + ROW_HEIGHT * ROWS + PADDING_BOTTOM;
37: public static final int KEYS = 113;
38: public static final int BOXES = 114;
39: public static final int TAB = 15;
40: public static final int LEFT_SHIFT = 108;
41: public static final int RIGHT_SHIFT = 113;
42:
43:
44: public static Color backgroundColor;
45: public static Color assignedColor;
46: public static Color focusedColor;
47: public static Color foregroundColor;
48:
49:
50: public JPanel keyboardPanel;
51: public JComponent mainPanel;
52:
53:
54: public int[] currentMap;
55: public int focusedBox;
56: public JTextArea[] textAreaArray;
57:
58:
59: public static javax.swing.filechooser.FileFilter txtFileFilter;
60: public static File lastFile;
61:
62:
63: public static LinkedList<int[]> undoList;
64: public static LinkedList<int[]> redoList;
65: public static final int UNDO_LIST_MAX_LENGTH = 1000;
66:
67:
68: @SuppressWarnings ("this-escape") public KeyMapEditor (int[] map) {
69:
70:
71: currentMap = map;
72:
73:
74: txtFileFilter = new javax.swing.filechooser.FileFilter () {
75: @Override public boolean accept (File file) {
76: String name = file.getName ();
77: String lowerName = name.toLowerCase ();
78: return (file.isDirectory () ||
79: (file.isFile () &&
80: (lowerName.endsWith (".csv") ||
81: lowerName.endsWith (".txt"))));
82: }
83: @Override public String getDescription () {
84: return (Multilingual.mlnJapanese ?
85: "CSV またはテキストファイル (*.csv,*.txt)" :
86: "CSV or text file (*.csv,*.txt)");
87: }
88: };
89: lastFile = new File ("keymap.csv").getAbsoluteFile ();
90:
91:
92: undoList = new LinkedList<int[]> ();
93: redoList = new LinkedList<int[]> ();
94:
95:
96: backgroundColor = new Color (LnF.lnfRGB[0]);
97: assignedColor = new Color (LnF.lnfRGB[4]);
98: focusedColor = new Color (LnF.lnfRGB[8]);
99: foregroundColor = Color.white;
100:
101:
102: keyboardPanel = new JPanel ();
103: keyboardPanel.setLayout (null);
104: keyboardPanel.setPreferredSize (new Dimension (KEYBOARD_WIDTH, KEYBOARD_HEIGHT));
105:
106:
107: focusedBox = -1;
108: FocusListener focusListener = new FocusAdapter () {
109: @Override public void focusGained (FocusEvent fe) {
110: int xo = Integer.parseInt (fe.getComponent ().getName ());
111: if (focusedBox != -1) {
112: Color color = currentMap[3 * xo] != 0 ? assignedColor : backgroundColor;
113: textAreaArray[focusedBox].setBackground (color);
114: if (focusedBox == LEFT_SHIFT) {
115: textAreaArray[RIGHT_SHIFT].setBackground (color);
116: }
117:
118: }
119: focusedBox = xo;
120: textAreaArray[focusedBox].setBackground (focusedColor);
121: if (focusedBox == LEFT_SHIFT) {
122: textAreaArray[RIGHT_SHIFT].setBackground (focusedColor);
123: }
124: }
125: @Override public void focusLost (FocusEvent fe) {
126: int xo = Integer.parseInt (fe.getComponent ().getName ());
127: if (focusedBox != -1) {
128: Color color = currentMap[3 * xo] != 0 ? assignedColor : backgroundColor;
129: textAreaArray[focusedBox].setBackground (color);
130: if (focusedBox == LEFT_SHIFT) {
131: textAreaArray[RIGHT_SHIFT].setBackground (color);
132: }
133: focusedBox = -1;
134: }
135: }
136: };
137:
138:
139: textAreaArray = new JTextArea[BOXES];
140: for (int xo = 0; xo < BOXES; xo++) {
141: textAreaArray[xo] = null;
142: int[] bounds = BOUNDS_ARRAY[xo];
143: JLabel label = ComponentFactory.createLabel (TEXT_ARRAY[xo]);
144: label.setFont (FONT);
145: label.setBounds (PADDING_LEFT + COL_WIDTH * bounds[0],
146: PADDING_TOP + ROW_HEIGHT * bounds[1],
147: COL_WIDTH * bounds[2],
148: LABEL_HEIGHT);
149: label.setHorizontalAlignment (SwingConstants.CENTER);
150: keyboardPanel.add (label);
151: JTextArea textArea = new JTextArea ();
152: textAreaArray[xo] = textArea;
153: textArea.setFont (FONT);
154: ComponentFactory.setEtchedBorder (textArea);
155: textArea.setLineWrap (true);
156:
157: textArea.setBackground (backgroundColor);
158: textArea.setForeground (foregroundColor);
159: textArea.setCursor (Cursor.getPredefinedCursor (Cursor.HAND_CURSOR));
160: textArea.setName (String.valueOf (xo == RIGHT_SHIFT ? LEFT_SHIFT : xo));
161: textArea.setBounds (PADDING_LEFT + COL_WIDTH * bounds[0],
162: PADDING_TOP + ROW_HEIGHT * bounds[1] + LABEL_HEIGHT,
163: COL_WIDTH * bounds[2],
164: ROW_HEIGHT * bounds[3] - LABEL_HEIGHT);
165: if (xo == TAB) {
166: textArea.setFocusTraversalKeysEnabled (false);
167: } else {
168: textArea.setFocusTraversalKeysEnabled (true);
169: }
170: textArea.addKeyListener (this);
171: textArea.addFocusListener (focusListener);
172: keyboardPanel.add (textArea);
173: }
174: updateTextAll ();
175:
176:
177: mainPanel = new JScrollPane (keyboardPanel);
178:
179: mainPanel.setPreferredSize (new Dimension (Math.min (700, KEYBOARD_WIDTH + 20), KEYBOARD_HEIGHT + 20));
180:
181: }
182:
183:
184: public JComponent getPanel () {
185: return mainPanel;
186: }
187:
188:
189: public void blank () {
190: if (JOptionPane.showConfirmDialog (
191: null,
192: Multilingual.mlnJapanese ? "キー割り当てを白紙にしますか?" : "Do you want to blank the key assignments?",
193: Multilingual.mlnJapanese ? "確認" : "Confirmation",
194: JOptionPane.YES_NO_OPTION,
195: JOptionPane.PLAIN_MESSAGE) != JOptionPane.YES_OPTION) {
196: return;
197: }
198: beforeChange ();
199: Arrays.fill (currentMap, 0);
200: updateTextAll ();
201: }
202:
203:
204: public void reset (int[] map) {
205: if (JOptionPane.showConfirmDialog (
206: null,
207: Multilingual.mlnJapanese ? "キー割り当てを初期値に戻しますか?" : "Do you want to reset the key assignments to default?",
208: Multilingual.mlnJapanese ? "確認" : "Confirmation",
209: JOptionPane.YES_NO_OPTION,
210: JOptionPane.PLAIN_MESSAGE) != JOptionPane.YES_OPTION) {
211: return;
212: }
213: beforeChange ();
214: System.arraycopy (map, 0,
215: currentMap, 0,
216: currentMap.length);
217: updateTextAll ();
218: }
219:
220:
221: public void save () {
222: JFileChooser2 fileChooser = new JFileChooser2 (lastFile);
223: fileChooser.setFileFilter (txtFileFilter);
224: if (fileChooser.showSaveDialog (null) == JFileChooser.APPROVE_OPTION) {
225: File file = fileChooser.getSelectedFile ();
226: String path = file.getPath ();
227: String lowerPath = path.toLowerCase ();
228: if (lowerPath.endsWith (".csv")) {
229: saveCSV (path);
230: file = lastFile;
231: } else if (lowerPath.endsWith (".txt")) {
232: saveText (path);
233: file = lastFile;
234: }
235: }
236: }
237:
238:
239: public void saveCSV (String path) {
240: StringBuilder sb = new StringBuilder ();
241: sb.append (XEiJ.prgIsMac ?
242: "X68000,keyCode,extendedKeyCode,keyLocation,keytop\r\n" :
243: "X68000,keyCode,rawCode,keyLocation,keytop\r\n");
244: for (int xo = 0; xo < KEYS; xo++) {
245: for (int i = 0; i < 3; i++) {
246: int t = currentMap[3 * xo + i];
247: if (t == 0) {
248: break;
249: }
250: sb.append (xo + (xo < 108 ? 1 : 4));
251: sb.append (",");
252: sb.append ((t >> 16) & (XEiJ.prgIsMac ? 0x00000fff : 0x0000ffff));
253: sb.append (",");
254: sb.append ((t >> 4) & (XEiJ.prgIsMac ? 0x0f000fff : 0x00000fff));
255: sb.append (",");
256: sb.append (t & 0xf);
257: sb.append (",【");
258: sb.append (TEXT_ARRAY[xo]);
259: sb.append ("】\r\n");
260: }
261: }
262: XEiJ.rscPutTextFile (path, sb.toString (), "cp932");
263: }
264:
265:
266: public void saveText (String path) {
267: StringBuilder sb = new StringBuilder ();
268: int length = currentMap.length;
269: while (0 < length && currentMap[length - 1] == 0) {
270: length--;
271: }
272: sb.append ("keymap=-3");
273: for (int i = 0; i < length; i++) {
274: sb.append (',');
275: if (currentMap[i] != 0) {
276: sb.append (currentMap[i]);
277: }
278: }
279: sb.append ("\n");
280: XEiJ.rscPutTextFile (path, sb.toString ());
281: }
282:
283:
284: public void restore () {
285: JFileChooser2 fileChooser = new JFileChooser2 (lastFile);
286: fileChooser.setFileFilter (txtFileFilter);
287: if (fileChooser.showOpenDialog (null) != JFileChooser.APPROVE_OPTION) {
288: return;
289: }
290: File file = fileChooser.getSelectedFile ();
291: String path = file.getPath ();
292: String lowerPath = path.toLowerCase ();
293: if (lowerPath.endsWith (".csv")) {
294: if (restoreCSV (path)) {
295: lastFile = file;
296: }
297: } else if (lowerPath.endsWith (".txt")) {
298: if (restoreText (path)) {
299: lastFile = file;
300: }
301: }
302: }
303:
304:
305: public boolean restoreCSV (String path) {
306: String string = XEiJ.rscGetTextFile (path, "cp932");
307: if (string.length () == 0) {
308: return false;
309: }
310: String[] lines;
311: if (0 <= string.indexOf ("\r\n")) {
312: lines = string.split ("\r\n");
313: } else if (0 <= string.indexOf ("\n")) {
314: lines = string.split ("\n");
315: } else if (0 <= string.indexOf ("\r")) {
316: lines = string.split ("\r");
317: } else {
318: lines = new String[] { string };
319: }
320: int rows = lines.length;
321: if (rows < 1) {
322: return false;
323: }
324: int[] map = new int[3 * KEYS];
325: Arrays.fill (map, 0);
326: for (int row = 0; row < rows; row++) {
327: String[] line = lines[row].split (",");
328: int cols = line.length;
329: if (cols < 4) {
330: return false;
331: }
332: if (row == 0) {
333: String cell = line[0];
334: if (cell.startsWith ("\"") && cell.endsWith ("\"")) {
335: cell = cell.substring (1, cell.length () - 1);
336: }
337: cell = cell.trim ();
338: if (!cell.equals ("X68000")) {
339: return false;
340: }
341: continue;
342: }
343: int[] va = new int[4];
344: for (int col = 0; col < 4; col++) {
345: String cell = line[col];
346: if (cell.startsWith ("\"") && cell.endsWith ("\"")) {
347: cell = cell.substring (1, cell.length () - 1);
348: }
349: cell = cell.trim ();
350: try {
351: va[col] = Integer.parseInt (cell, 10);
352: } catch (NumberFormatException nfe) {
353: return false;
354: }
355: }
356: int v0 = va[0];
357: int v1 = va[1];
358: int v2 = va[2];
359: int v3 = va[3];
360: if (!(((1 <= v0 && v0 <= 108) || (112 <= v0 && v0 <= 116)) &&
361: (v1 & 0xfff) == v1 &&
362: (v2 & 0xf000fff) == v2 &&
363: (v3 & 0xf) == v3)) {
364: return false;
365: }
366: int t = v1 << 16 | v2 << 4 | v3;
367: if (t == 0) {
368: return false;
369: }
370: int xo = v0 - (v0 < 112 ? 1 : 4);
371: if (map[3 * xo] == 0) {
372: map[3 * xo] = t;
373: } else if (map[3 * xo + 1] == 0) {
374: map[3 * xo + 1] = t;
375: } else if (map[3 * xo + 2] == 0) {
376: map[3 * xo + 2] = t;
377: } else {
378: return false;
379: }
380: }
381: beforeChange ();
382: System.arraycopy (map, 0, currentMap, 0, map.length);
383: updateTextAll ();
384: return true;
385: }
386:
387:
388: public boolean restoreText (String path) {
389: String string = XEiJ.rscGetTextFile (path);
390: if (string.length () == 0) {
391: return false;
392: }
393: String[] lr = string.split ("=");
394: if (lr.length != 2) {
395: return false;
396: }
397: String l = lr[0].trim ();
398: String r = lr[1].trim ();
399: if (!l.equals ("keymap")) {
400: return false;
401: }
402: String[] sa = r.split (",");
403: int[] ia = new int[sa.length];
404: for (int i = 0; i < sa.length; i++) {
405: String s = sa[i].trim ();
406: if (s.length () == 0) {
407: ia[i] = 0;
408: } else {
409: try {
410: ia[i] = Integer.parseInt (s, 10);
411: } catch (NumberFormatException nfe) {
412: return false;
413: }
414: }
415: }
416: if (ia.length < 1 ||
417: 1 + 3 * KEYS < ia.length ||
418: ia[0] != -3) {
419: return false;
420: }
421: int[] map = new int[3 * KEYS];
422: Arrays.fill (map, 0);
423: for (int i = 0; i < 3 * KEYS; i++) {
424: if (1 + i < ia.length) {
425: map[i] = ia[1 + i];
426: }
427: }
428: beforeChange ();
429: System.arraycopy (map, 0, currentMap, 0, map.length);
430: updateTextAll ();
431: return true;
432: }
433:
434:
435: public void undo () {
436: if (!undoList.isEmpty ()) {
437: int[] map = new int[currentMap.length];
438: System.arraycopy (currentMap, 0, map, 0, currentMap.length);
439: redoList.addFirst (map);
440: map = undoList.removeLast ();
441: System.arraycopy (map, 0, currentMap, 0, currentMap.length);
442: updateTextAll ();
443: }
444: }
445:
446:
447: public void redo () {
448: if (!redoList.isEmpty ()) {
449: int[] map = new int[currentMap.length];
450: System.arraycopy (currentMap, 0, map, 0, currentMap.length);
451: undoList.addLast (map);
452: map = redoList.removeFirst ();
453: System.arraycopy (map, 0, currentMap, 0, currentMap.length);
454: updateTextAll ();
455: }
456: }
457:
458:
459:
460:
461: public void beforeChange () {
462: if (undoList.size () == UNDO_LIST_MAX_LENGTH) {
463: undoList.removeFirst ();
464: }
465: redoList.clear ();
466: int[] map = new int[currentMap.length];
467: System.arraycopy (currentMap, 0, map, 0, currentMap.length);
468: undoList.addLast (map);
469: }
470:
471:
472:
473:
474: @Override public void keyPressed (KeyEvent ke) {
475: closeIME (ke);
476: pressed:
477: {
478: beforeChange ();
479: int xo = Integer.parseInt (ke.getComponent ().getName ());
480: int keyCode = ke.getKeyCode ();
481: if (true) {
482: if (xo != 0 && keyCode == KeyEvent.VK_ESCAPE) {
483: currentMap[3 * xo] = 0;
484: currentMap[3 * xo + 1] = 0;
485: currentMap[3 * xo + 2] = 0;
486: updateText (xo);
487: break pressed;
488: }
489: }
490: if ((xo != 108 && keyCode == KeyEvent.VK_SHIFT) ||
491: (xo != 109 && keyCode == KeyEvent.VK_CONTROL)) {
492: break pressed;
493: }
494: int keyLocation = ke.getKeyLocation ();
495: int extendedOrRaw = XEiJ.prgIsMac ? ke.getExtendedKeyCode () : getRawCode (ke);
496: int intCode = keyCode << 16 | extendedOrRaw << 4 | keyLocation;
497: if ((keyCode & (XEiJ.prgIsMac ? 0x00000fff : 0x0000ffff)) != keyCode ||
498: (extendedOrRaw & (XEiJ.prgIsMac ? 0x0f000fff : 0x00000fff)) != extendedOrRaw ||
499: (keyLocation & 0x0000000f) != keyLocation ||
500: intCode == 0) {
501: System.out.printf ("KeyEvent: keyCode=0x%08x, extendedOrRaw=0x%08x, keyLocation=0x%08x\n",
502: keyCode, extendedOrRaw, keyLocation);
503: break pressed;
504: }
505: if (false) {
506: if (currentMap[3 * xo] == intCode &&
507: currentMap[3 * xo + 1] == 0) {
508: currentMap[3 * xo] = 0;
509: updateText (xo);
510: break pressed;
511: }
512: }
513: if (currentMap[3 * xo] == intCode ||
514: currentMap[3 * xo + 1] == intCode ||
515: currentMap[3 * xo + 2] == intCode) {
516: currentMap[3 * xo] = intCode;
517: currentMap[3 * xo + 1] = 0;
518: currentMap[3 * xo + 2] = 0;
519: updateText (xo);
520: break pressed;
521: }
522: if (currentMap[3 * xo + 2] != 0) {
523: currentMap[3 * xo] = currentMap[3 * xo + 1];
524: currentMap[3 * xo + 1] = currentMap[3 * xo + 2];
525: currentMap[3 * xo + 2] = 0;
526: }
527: if (currentMap[3 * xo] == 0) {
528: currentMap[3 * xo] = intCode;
529: } else if (currentMap[3 * xo + 1] == 0) {
530: currentMap[3 * xo + 1] = intCode;
531: } else {
532: currentMap[3 * xo + 2] = intCode;
533: }
534: updateText (xo);
535: for (int xp = 0; xp < KEYS; xp++) {
536: if (xp != xo) {
537: if (currentMap[3 * xp] == intCode) {
538: currentMap[3 * xp] = currentMap[3 * xp + 1];
539: currentMap[3 * xp + 1] = currentMap[3 * xp + 2];
540: currentMap[3 * xp + 2] = 0;
541: updateText (xp);
542: break;
543: }
544: if (currentMap[3 * xp + 1] == intCode) {
545: currentMap[3 * xp + 1] = currentMap[3 * xp + 2];
546: currentMap[3 * xp + 2] = 0;
547: updateText (xp);
548: break;
549: }
550: if (currentMap[3 * xp + 2] == intCode) {
551: currentMap[3 * xp + 2] = 0;
552: updateText (xp);
553: break;
554: }
555: }
556: }
557: }
558: ke.consume ();
559: }
560:
561: @Override public void keyReleased (KeyEvent ke) {
562: closeIME (ke);
563: ke.consume ();
564: }
565:
566: @Override public void keyTyped (KeyEvent ke) {
567: closeIME (ke);
568: ke.consume ();
569: }
570:
571: public void closeIME (KeyEvent ke) {
572: JTextArea textArea = (JTextArea) ke.getComponent ();
573: try {
574: InputContext context = textArea.getInputContext ();
575: if (context != null && context.isCompositionEnabled ()) {
576: context.setCompositionEnabled (false);
577:
578: }
579: } catch (UnsupportedOperationException uoe) {
580: }
581: }
582:
583: public void updateTextAll () {
584: for (int xo = 0; xo < KEYS; xo++) {
585: updateText (xo);
586: }
587: }
588:
589:
590: public void updateText (int xo) {
591: StringBuilder sb = new StringBuilder ();
592: for (int i = 0; i < 3; i++) {
593: int intCode = currentMap[3 * xo + i];
594: if (intCode == 0) {
595: if (i == 0) {
596:
597: }
598: break;
599: }
600: if (i != 0) {
601:
602:
603: sb.append (" ");
604: }
605: int keyCode = (intCode >> 16) & (XEiJ.prgIsMac ? 0x00000fff : 0x0000ffff);
606: int extendedOrRaw = (intCode >> 4) & (XEiJ.prgIsMac ? 0x0f000fff : 0x00000fff);
607: int keyLocation = intCode & 0x0000000f;
608: switch (keyLocation) {
609: case 2:
610: sb.append (Multilingual.mlnJapanese ? "左" : "Left ");
611: break;
612: case 3:
613: sb.append (Multilingual.mlnJapanese ? "右" : "Right ");
614: break;
615: case 4:
616:
617: sb.append ("#");
618: break;
619: }
620: sb.append (KeyEvent.getKeyText (XEiJ.prgIsMac && extendedOrRaw != 0 ? extendedOrRaw : keyCode));
621: }
622: String text = sb.toString ();
623: if (!text.equals (textAreaArray[xo].getText ())) {
624: Color color = xo == focusedBox ? focusedColor : currentMap[3 * xo] != 0 ? assignedColor : backgroundColor;
625: textAreaArray[xo].setText (text);
626: textAreaArray[xo].setBackground (color);
627: if (xo == LEFT_SHIFT) {
628: textAreaArray[RIGHT_SHIFT].setText (text);
629: textAreaArray[RIGHT_SHIFT].setBackground (color);
630: }
631: }
632: }
633:
634:
635:
636: public int getRawCode (KeyEvent ke) {
637: int rawCode = 0;
638:
639: String s = ke.paramString ();
640: int i = s.indexOf ("rawCode=");
641: if (0 <= i) {
642: i += 8;
643: for (int k = s.length (); i < k; i++) {
644: char c = s.charAt (i);
645: if (c < '0' || '9' < c) {
646: break;
647: }
648: rawCode = rawCode * 10 + (c - '0');
649: }
650: }
651: return rawCode;
652: }
653:
654:
655: public static final int[][] BOUNDS_ARRAY = {
656: { 0, 5, 4, 4 },
657: { 4, 5, 4, 4 },
658: { 8, 5, 4, 4 },
659: { 12, 5, 4, 4 },
660: { 16, 5, 4, 4 },
661: { 20, 5, 4, 4 },
662: { 24, 5, 4, 4 },
663: { 28, 5, 4, 4 },
664: { 32, 5, 4, 4 },
665: { 36, 5, 4, 4 },
666: { 40, 5, 4, 4 },
667: { 44, 5, 4, 4 },
668: { 48, 5, 4, 4 },
669: { 52, 5, 4, 4 },
670: { 56, 5, 6, 4 },
671: { 0, 9, 6, 4 },
672: { 6, 9, 4, 4 },
673: { 10, 9, 4, 4 },
674: { 14, 9, 4, 4 },
675: { 18, 9, 4, 4 },
676: { 22, 9, 4, 4 },
677: { 26, 9, 4, 4 },
678: { 30, 9, 4, 4 },
679: { 34, 9, 4, 4 },
680: { 38, 9, 4, 4 },
681: { 42, 9, 4, 4 },
682: { 46, 9, 4, 4 },
683: { 50, 9, 4, 4 },
684: { 55, 9, 7, 8 },
685: { 7, 13, 4, 4 },
686: { 11, 13, 4, 4 },
687: { 15, 13, 4, 4 },
688: { 19, 13, 4, 4 },
689: { 23, 13, 4, 4 },
690: { 27, 13, 4, 4 },
691: { 31, 13, 4, 4 },
692: { 35, 13, 4, 4 },
693: { 39, 13, 4, 4 },
694: { 43, 13, 4, 4 },
695: { 47, 13, 4, 4 },
696: { 51, 13, 4, 4 },
697: { 9, 17, 4, 4 },
698: { 13, 17, 4, 4 },
699: { 17, 17, 4, 4 },
700: { 21, 17, 4, 4 },
701: { 25, 17, 4, 4 },
702: { 29, 17, 4, 4 },
703: { 33, 17, 4, 4 },
704: { 37, 17, 4, 4 },
705: { 41, 17, 4, 4 },
706: { 45, 17, 4, 4 },
707: { 49, 17, 4, 4 },
708: { 21, 21, 14, 4 },
709: { 64, 5, 4, 4 },
710: { 72, 5, 4, 4 },
711: { 64, 9, 4, 4 },
712: { 68, 9, 4, 4 },
713: { 72, 9, 4, 4 },
714: { 64, 13, 4, 8 },
715: { 68, 13, 4, 4 },
716: { 72, 13, 4, 8 },
717: { 68, 17, 4, 4 },
718: { 78, 5, 4, 4 },
719: { 82, 5, 4, 4 },
720: { 86, 5, 4, 4 },
721: { 90, 5, 4, 4 },
722: { 78, 9, 4, 4 },
723: { 82, 9, 4, 4 },
724: { 86, 9, 4, 4 },
725: { 90, 9, 4, 4 },
726: { 78, 13, 4, 4 },
727: { 82, 13, 4, 4 },
728: { 86, 13, 4, 4 },
729: { 90, 13, 4, 4 },
730: { 78, 17, 4, 4 },
731: { 82, 17, 4, 4 },
732: { 86, 17, 4, 4 },
733: { 90, 17, 4, 8 },
734: { 78, 21, 4, 4 },
735: { 82, 21, 4, 4 },
736: { 86, 21, 4, 4 },
737: { 82, 0, 4, 4 },
738: { 86, 0, 4, 4 },
739: { 90, 0, 4, 4 },
740: { 11, 21, 5, 4 },
741: { 16, 21, 5, 4 },
742: { 35, 21, 6, 4 },
743: { 41, 21, 5, 4 },
744: { 46, 21, 5, 4 },
745: { 64, 0, 4, 4 },
746: { 68, 0, 4, 4 },
747: { 72, 0, 4, 4 },
748: { 78, 0, 4, 4 },
749: { 68, 5, 4, 4 },
750: { 7, 21, 4, 4 },
751: { 51, 21, 4, 4 },
752: { 0, 0, 4, 4 },
753: { 5, 0, 4, 4 },
754: { 11, 1, 5, 3 },
755: { 16, 1, 5, 3 },
756: { 21, 1, 5, 3 },
757: { 26, 1, 5, 3 },
758: { 31, 1, 5, 3 },
759: { 37, 1, 5, 3 },
760: { 42, 1, 5, 3 },
761: { 47, 1, 5, 3 },
762: { 52, 1, 5, 3 },
763: { 57, 1, 5, 3 },
764: { 0, 17, 9, 4 },
765: { 0, 13, 7, 4 },
766: { 64, 21, 6, 4 },
767: { 70, 21, 6, 4 },
768: { 0, 21, 4, 4 },
769:
770: { 53, 17, 9, 4 },
771: };
772:
773:
774: public static final String[] TEXT_ARRAY = (
775: "ESC," +
776: "1!ぬ ," +
777: "2"ふ ," +
778: "3#あぁ," +
779: "4$うぅ," +
780: "5%えぇ," +
781: "6&おぉ," +
782: "7'やゃ," +
783: "8(ゆゅ," +
784: "9)よょ," +
785: "0 わを," +
786: "-=ほ ," +
787: "^~へ ," +
788: "¥|ー ," +
789: "BS," +
790: "TAB," +
791: "Q た ," +
792: "W て ," +
793: "E いぃ," +
794: "R す ," +
795: "T か ," +
796: "Y ん ," +
797: "U な ," +
798: "I に ," +
799: "O ら ," +
800: "P せ ," +
801: "@`゛ ," +
802: "[{゜「," +
803: "リターン," +
804: "A ち ," +
805: "S と ," +
806: "D し ," +
807: "F は ," +
808: "G き ," +
809: "H く ," +
810: "J ま ," +
811: "K の ," +
812: "L り ," +
813: ";+れ ," +
814: ":*け ," +
815: "]}む」," +
816: "Z つっ," +
817: "X さ ," +
818: "C そ ," +
819: "V ひ ," +
820: "B こ ," +
821: "N み ," +
822: "M も ," +
823: ",<ね、," +
824: ".>る。," +
825: "/?め・," +
826: " _ろ□," +
827: "スペース," +
828: "HOME," +
829: "DEL," +
830: "ROLLUP," +
831: "ROLLDOWN," +
832: "UNDO," +
833: "←," +
834: "↑," +
835: "→," +
836: "↓," +
837: "CLR," +
838: "/," +
839: "*," +
840: "-," +
841: "7," +
842: "8," +
843: "9," +
844: "+," +
845: "4," +
846: "5," +
847: "6," +
848: "=," +
849: "1," +
850: "2," +
851: "3," +
852: "ENTER," +
853: "0," +
854: ",," +
855: ".," +
856: "記号入力," +
857: "登録," +
858: "HELP," +
859: "XF1," +
860: "XF2," +
861: "XF3," +
862: "XF4," +
863: "XF5," +
864: "かな," +
865: "ローマ字," +
866: "コード入力," +
867: "CAPS," +
868: "INS," +
869: "ひらがな," +
870: "全角," +
871: "BREAK," +
872: "COPY," +
873: "F1," +
874: "F2," +
875: "F3," +
876: "F4," +
877: "F5," +
878: "F6," +
879: "F7," +
880: "F8," +
881: "F9," +
882: "F10," +
883: "SHIFT," +
884: "CTRL," +
885: "OPT.1," +
886: "OPT.2," +
887: "NUM," +
888:
889: "SHIFT"
890: ).split (",");
891:
892: }
893: