OSDN Git Service

Fixed noncontinuous rendering.
[mikumikustudio/libgdx-mikumikustudio.git] / backends / gdx-backend-jglfw / src / com / badlogic / gdx / backends / jglfw / JglfwInput.java
1
2 package com.badlogic.gdx.backends.jglfw;
3
4 import static com.badlogic.jglfw.Glfw.*;
5
6 import com.badlogic.gdx.Gdx;
7 import com.badlogic.gdx.Input;
8 import com.badlogic.gdx.InputProcessor;
9 import com.badlogic.gdx.utils.GdxRuntimeException;
10 import com.badlogic.jglfw.GlfwCallback;
11
12 import java.awt.Color;
13 import java.awt.FlowLayout;
14 import java.awt.event.WindowEvent;
15 import java.awt.event.WindowFocusListener;
16
17 import javax.swing.JDialog;
18 import javax.swing.JLabel;
19 import javax.swing.JOptionPane;
20 import javax.swing.JPanel;
21 import javax.swing.JTextField;
22 import javax.swing.OverlayLayout;
23 import javax.swing.SwingUtilities;
24 import javax.swing.border.EmptyBorder;
25 import javax.swing.event.DocumentEvent;
26 import javax.swing.event.DocumentListener;
27
28 /** An implementation of the {@link Input} interface hooking GLFW panel for input.
29  * @author mzechner
30  * @author Nathan Sweet */
31 public class JglfwInput implements Input {
32         JglfwGraphics graphics;
33         InputProcessor processor;
34         int pressedKeys = 0;
35         boolean justTouched = false;
36         long currentEventTimeStamp;
37         int deltaX, deltaY;
38
39         public JglfwInput (JglfwGraphics graphics) {
40                 this.graphics = graphics;
41
42                 glfwSetCallback(new GlfwCallback() {
43                         private int mouseX, mouseY, mousePressed;
44                         private char lastCharacter;
45
46                         public void key (long window, int key, int action) {
47                                 switch (action) {
48                                 case GLFW_PRESS:
49                                         if (processor != null) processor.keyDown(getGdxKeyCode(key));
50                                         break;
51                                 case GLFW_RELEASE:
52                                         if (processor != null) processor.keyDown(getGdxKeyCode(key));
53                                         break;
54                                 case GLFW_REPEAT:
55                                         if (processor != null && lastCharacter != 0) processor.keyTyped(lastCharacter);
56                                         break;
57                                 }
58                                 Gdx.graphics.requestRendering();
59                         }
60
61                         public void character (long window, char character) {
62                                 lastCharacter = character;
63                                 if (processor != null) processor.keyTyped(character);
64                                 Gdx.graphics.requestRendering();
65                         }
66
67                         public void scroll (long window, double scrollX, double scrollY) {
68                                 if (processor != null) processor.scrolled((int)-Math.signum(scrollY));
69                                 Gdx.graphics.requestRendering();
70                         }
71
72                         public void mouseButton (long window, int button, boolean pressed) {
73                                 if (pressed) {
74                                         mousePressed++;
75                                         if (processor != null) processor.touchDown(mouseX, mouseY, 0, button);
76                                 } else {
77                                         mousePressed--;
78                                         if (processor != null) processor.touchUp(mouseX, mouseY, 0, button);
79                                 }
80                                 Gdx.graphics.requestRendering();
81                         }
82
83                         public void cursorPos (long window, int x, int y) {
84                                 mouseX = x;
85                                 mouseY = y;
86                                 if (processor != null) {
87                                         if (mousePressed > 0)
88                                                 processor.touchDragged(mouseX, mouseY, 0);
89                                         else
90                                                 processor.mouseMoved(mouseX, mouseY);
91                                 }
92                                 Gdx.graphics.requestRendering();
93                         }
94
95                         public void cursorEnter (long window, boolean entered) {
96                         }
97
98                         public void windowSize (long window, int width, int height) {
99                         }
100
101                         public void windowRefresh (long window) {
102                         }
103
104                         public void windowPos (long window, int x, int y) {
105                         }
106
107                         public void windowIconify (long window, boolean iconified) {
108                         }
109
110                         public void windowFocus (long window, boolean focused) {
111                         }
112
113                         public boolean windowClose (long window) {
114                                 return true;
115                         }
116
117                         public void monitor (long monitor, boolean connected) {
118                         }
119
120                         public void error (int error, String description) {
121                                 throw new GdxRuntimeException("GLFW error " + error + ": " + description);
122                         }
123                 });
124         }
125
126         public float getAccelerometerX () {
127                 return 0;
128         }
129
130         public float getAccelerometerY () {
131                 return 0;
132         }
133
134         public float getAccelerometerZ () {
135                 return 0;
136         }
137
138         public int getX () {
139                 return glfwGetCursorPosX(graphics.window);
140         }
141
142         public int getX (int pointer) {
143                 if (pointer > 0)
144                         return 0;
145                 else
146                         return getX();
147         }
148
149         public int getY () {
150                 return graphics.getHeight() - 1 - glfwGetCursorPosY(graphics.window);
151         }
152
153         public int getY (int pointer) {
154                 if (pointer > 0)
155                         return 0;
156                 else
157                         return getY();
158         }
159
160         public int getDeltaX () {
161                 return deltaX;
162         }
163
164         public int getDeltaX (int pointer) {
165                 if (pointer > 0)
166                         return 0;
167                 else
168                         return deltaX;
169         }
170
171         public int getDeltaY () {
172                 return deltaY;
173         }
174
175         public int getDeltaY (int pointer) {
176                 if (pointer > 0)
177                         return 0;
178                 else
179                         return deltaY;
180         }
181
182         public boolean isTouched () {
183                 return glfwGetMouseButton(graphics.window, 0) || glfwGetMouseButton(graphics.window, 1)
184                         || glfwGetMouseButton(graphics.window, 2);
185         }
186
187         public boolean justTouched () {
188                 return justTouched;
189         }
190
191         public boolean isTouched (int pointer) {
192                 if (pointer > 0)
193                         return false;
194                 else
195                         return isTouched();
196         }
197
198         public boolean isButtonPressed (int button) {
199                 return glfwGetMouseButton(graphics.window, button);
200         }
201
202         public boolean isKeyPressed (int key) {
203                 if (key == Input.Keys.ANY_KEY)
204                         return pressedKeys > 0;
205                 else
206                         return glfwGetKey(graphics.window, key);
207         }
208
209         public void getTextInput (final TextInputListener listener, final String title, final String text) {
210                 SwingUtilities.invokeLater(new Runnable() {
211                         public void run () {
212                                 final String output = JOptionPane.showInputDialog(null, title, text);
213                                 Gdx.app.postRunnable(new Runnable() {
214                                         public void run () {
215                                                 if (output != null)
216                                                         listener.input(output);
217                                                 else
218                                                         listener.canceled();
219                                         }
220                                 });
221                         }
222                 });
223         }
224
225         public void getPlaceholderTextInput (final TextInputListener listener, final String title, final String placeholder) {
226                 SwingUtilities.invokeLater(new Runnable() {
227                         public void run () {
228                                 JPanel panel = new JPanel(new FlowLayout());
229
230                                 JPanel textPanel = new JPanel() {
231                                         public boolean isOptimizedDrawingEnabled () {
232                                                 return false;
233                                         };
234                                 };
235                                 textPanel.setLayout(new OverlayLayout(textPanel));
236                                 panel.add(textPanel);
237
238                                 final JTextField textField = new JTextField(20);
239                                 textField.setAlignmentX(0.0f);
240                                 textPanel.add(textField);
241
242                                 final JLabel placeholderLabel = new JLabel(placeholder);
243                                 placeholderLabel.setForeground(Color.GRAY);
244                                 placeholderLabel.setAlignmentX(0.0f);
245                                 textPanel.add(placeholderLabel, 0);
246
247                                 textField.getDocument().addDocumentListener(new DocumentListener() {
248                                         public void removeUpdate (DocumentEvent event) {
249                                                 this.updated();
250                                         }
251
252                                         public void insertUpdate (DocumentEvent event) {
253                                                 this.updated();
254                                         }
255
256                                         public void changedUpdate (DocumentEvent event) {
257                                                 this.updated();
258                                         }
259
260                                         private void updated () {
261                                                 placeholderLabel.setVisible(textField.getText().length() == 0);
262                                         }
263                                 });
264
265                                 JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null,
266                                         null);
267                                 pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation());
268                                 pane.selectInitialValue();
269
270                                 placeholderLabel.setBorder(new EmptyBorder(textField.getBorder().getBorderInsets(textField)));
271
272                                 JDialog dialog = pane.createDialog(null, title);
273                                 dialog.addWindowFocusListener(new WindowFocusListener() {
274                                         public void windowLostFocus (WindowEvent arg0) {
275                                         }
276
277                                         public void windowGainedFocus (WindowEvent arg0) {
278                                                 textField.requestFocusInWindow();
279                                         }
280                                 });
281                                 dialog.setVisible(true);
282                                 dialog.dispose();
283
284                                 Object selectedValue = pane.getValue();
285                                 if (selectedValue != null && (selectedValue instanceof Integer) && (Integer)selectedValue == JOptionPane.OK_OPTION)
286                                         listener.input(textField.getText());
287                                 else
288                                         listener.canceled();
289                         }
290                 });
291         }
292
293         public void setOnscreenKeyboardVisible (boolean visible) {
294         }
295
296         public void vibrate (int milliseconds) {
297         }
298
299         public void vibrate (long[] pattern, int repeat) {
300         }
301
302         public void cancelVibrate () {
303         }
304
305         public float getAzimuth () {
306                 return 0;
307         }
308
309         public float getPitch () {
310                 return 0;
311         }
312
313         public float getRoll () {
314                 return 0;
315         }
316
317         public void getRotationMatrix (float[] matrix) {
318         }
319
320         public long getCurrentEventTime () {
321                 return currentEventTimeStamp;
322         }
323
324         public void setCatchBackKey (boolean catchBack) {
325         }
326
327         public void setCatchMenuKey (boolean catchMenu) {
328         }
329
330         public void setInputProcessor (InputProcessor processor) {
331                 this.processor = processor;
332         }
333
334         public InputProcessor getInputProcessor () {
335                 return processor;
336         }
337
338         public boolean isPeripheralAvailable (Peripheral peripheral) {
339                 if (peripheral == Peripheral.HardwareKeyboard) return true;
340                 return false;
341         }
342
343         public int getRotation () {
344                 return 0;
345         }
346
347         public Orientation getNativeOrientation () {
348                 return Orientation.Landscape;
349         }
350
351         public void setCursorCatched (boolean captured) {
352                 glfwSetInputMode(graphics.window, GLFW_CURSOR_MODE, captured ? GLFW_CURSOR_CAPTURED : GLFW_CURSOR_NORMAL);
353         }
354
355         public boolean isCursorCatched () {
356                 return glfwGetInputMode(graphics.window, GLFW_CURSOR_MODE) == GLFW_CURSOR_CAPTURED;
357         }
358
359         public void setCursorPosition (int x, int y) {
360                 glfwSetCursorPos(graphics.window, x, y);
361         }
362
363         public static int getGdxKeyCode (int lwjglKeyCode) {
364                 switch (lwjglKeyCode) {
365                 case GLFW_KEY_LEFT_BRACKET:
366                         return Input.Keys.LEFT_BRACKET;
367                 case GLFW_KEY_RIGHT_BRACKET:
368                         return Input.Keys.RIGHT_BRACKET;
369                 case GLFW_KEY_GRAVE_ACCENT:
370                         return Input.Keys.GRAVE;
371                 case GLFW_KEY_KP_MULTIPLY:
372                         return Input.Keys.STAR;
373                 case GLFW_KEY_NUM_LOCK:
374                         return Input.Keys.NUM;
375                 case GLFW_KEY_KP_DECIMAL:
376                         return Input.Keys.PERIOD;
377                 case GLFW_KEY_KP_DIVIDE:
378                         return Input.Keys.SLASH;
379                 case GLFW_KEY_MENU:
380                         return Input.Keys.SYM;
381                 case GLFW_KEY_KP_EQUAL:
382                         return Input.Keys.EQUALS;
383                 case GLFW_KEY_EQUAL:
384                         return Input.Keys.EQUALS;
385                 case GLFW_KEY_KP_ENTER:
386                         return Input.Keys.ENTER;
387                 case GLFW_KEY_0:
388                         return Input.Keys.NUM_0;
389                 case GLFW_KEY_1:
390                         return Input.Keys.NUM_1;
391                 case GLFW_KEY_2:
392                         return Input.Keys.NUM_2;
393                 case GLFW_KEY_3:
394                         return Input.Keys.NUM_3;
395                 case GLFW_KEY_4:
396                         return Input.Keys.NUM_4;
397                 case GLFW_KEY_5:
398                         return Input.Keys.NUM_5;
399                 case GLFW_KEY_6:
400                         return Input.Keys.NUM_6;
401                 case GLFW_KEY_7:
402                         return Input.Keys.NUM_7;
403                 case GLFW_KEY_8:
404                         return Input.Keys.NUM_8;
405                 case GLFW_KEY_9:
406                         return Input.Keys.NUM_9;
407                 case GLFW_KEY_A:
408                         return Input.Keys.A;
409                 case GLFW_KEY_B:
410                         return Input.Keys.B;
411                 case GLFW_KEY_C:
412                         return Input.Keys.C;
413                 case GLFW_KEY_D:
414                         return Input.Keys.D;
415                 case GLFW_KEY_E:
416                         return Input.Keys.E;
417                 case GLFW_KEY_F:
418                         return Input.Keys.F;
419                 case GLFW_KEY_G:
420                         return Input.Keys.G;
421                 case GLFW_KEY_H:
422                         return Input.Keys.H;
423                 case GLFW_KEY_I:
424                         return Input.Keys.I;
425                 case GLFW_KEY_J:
426                         return Input.Keys.J;
427                 case GLFW_KEY_K:
428                         return Input.Keys.K;
429                 case GLFW_KEY_L:
430                         return Input.Keys.L;
431                 case GLFW_KEY_M:
432                         return Input.Keys.M;
433                 case GLFW_KEY_N:
434                         return Input.Keys.N;
435                 case GLFW_KEY_O:
436                         return Input.Keys.O;
437                 case GLFW_KEY_P:
438                         return Input.Keys.P;
439                 case GLFW_KEY_Q:
440                         return Input.Keys.Q;
441                 case GLFW_KEY_R:
442                         return Input.Keys.R;
443                 case GLFW_KEY_S:
444                         return Input.Keys.S;
445                 case GLFW_KEY_T:
446                         return Input.Keys.T;
447                 case GLFW_KEY_U:
448                         return Input.Keys.U;
449                 case GLFW_KEY_V:
450                         return Input.Keys.V;
451                 case GLFW_KEY_W:
452                         return Input.Keys.W;
453                 case GLFW_KEY_X:
454                         return Input.Keys.X;
455                 case GLFW_KEY_Y:
456                         return Input.Keys.Y;
457                 case GLFW_KEY_Z:
458                         return Input.Keys.Z;
459                 case GLFW_KEY_LALT:
460                         return Input.Keys.ALT_LEFT;
461                 case GLFW_KEY_RALT:
462                         return Input.Keys.ALT_RIGHT;
463                 case GLFW_KEY_BACKSLASH:
464                         return Input.Keys.BACKSLASH;
465                 case GLFW_KEY_COMMA:
466                         return Input.Keys.COMMA;
467                 case GLFW_KEY_DELETE:
468                         return Input.Keys.FORWARD_DEL;
469                 case GLFW_KEY_LEFT:
470                         return Input.Keys.DPAD_LEFT;
471                 case GLFW_KEY_RIGHT:
472                         return Input.Keys.DPAD_RIGHT;
473                 case GLFW_KEY_UP:
474                         return Input.Keys.DPAD_UP;
475                 case GLFW_KEY_DOWN:
476                         return Input.Keys.DPAD_DOWN;
477                 case GLFW_KEY_ENTER:
478                         return Input.Keys.ENTER;
479                 case GLFW_KEY_HOME:
480                         return Input.Keys.HOME;
481                 case GLFW_KEY_MINUS:
482                         return Input.Keys.MINUS;
483                 case GLFW_KEY_PERIOD:
484                         return Input.Keys.PERIOD;
485                 case GLFW_KEY_KP_ADD:
486                         return Input.Keys.PLUS;
487                 case GLFW_KEY_SEMICOLON:
488                         return Input.Keys.SEMICOLON;
489                 case GLFW_KEY_LSHIFT:
490                         return Input.Keys.SHIFT_LEFT;
491                 case GLFW_KEY_RSHIFT:
492                         return Input.Keys.SHIFT_RIGHT;
493                 case GLFW_KEY_SLASH:
494                         return Input.Keys.SLASH;
495                 case GLFW_KEY_SPACE:
496                         return Input.Keys.SPACE;
497                 case GLFW_KEY_TAB:
498                         return Input.Keys.TAB;
499                 case GLFW_KEY_LEFT_CONTROL:
500                         return Input.Keys.CONTROL_LEFT;
501                 case GLFW_KEY_RIGHT_CONTROL:
502                         return Input.Keys.CONTROL_RIGHT;
503                 case GLFW_KEY_ESCAPE:
504                         return Input.Keys.ESCAPE;
505                 case GLFW_KEY_END:
506                         return Input.Keys.END;
507                 case GLFW_KEY_INSERT:
508                         return Input.Keys.INSERT;
509                 case GLFW_KEY_BACKSPACE:
510                         return Input.Keys.DEL;
511                 case GLFW_KEY_KP_SUBTRACT:
512                         return Input.Keys.MINUS;
513                 case GLFW_KEY_APOSTROPHE:
514                         return Input.Keys.APOSTROPHE;
515                 case GLFW_KEY_F1:
516                         return Input.Keys.F1;
517                 case GLFW_KEY_F2:
518                         return Input.Keys.F2;
519                 case GLFW_KEY_F3:
520                         return Input.Keys.F3;
521                 case GLFW_KEY_F4:
522                         return Input.Keys.F4;
523                 case GLFW_KEY_F5:
524                         return Input.Keys.F5;
525                 case GLFW_KEY_F6:
526                         return Input.Keys.F6;
527                 case GLFW_KEY_F7:
528                         return Input.Keys.F7;
529                 case GLFW_KEY_F8:
530                         return Input.Keys.F8;
531                 case GLFW_KEY_F9:
532                         return Input.Keys.F9;
533                 case GLFW_KEY_F10:
534                         return Input.Keys.F10;
535                 case GLFW_KEY_F11:
536                         return Input.Keys.F11;
537                 case GLFW_KEY_F12:
538                         return Input.Keys.F12;
539                 case GLFW_KEY_KP_0:
540                         return Input.Keys.NUM_0;
541                 case GLFW_KEY_KP_1:
542                         return Input.Keys.NUM_1;
543                 case GLFW_KEY_KP_2:
544                         return Input.Keys.NUM_2;
545                 case GLFW_KEY_KP_3:
546                         return Input.Keys.NUM_3;
547                 case GLFW_KEY_KP_4:
548                         return Input.Keys.NUM_4;
549                 case GLFW_KEY_KP_5:
550                         return Input.Keys.NUM_5;
551                 case GLFW_KEY_KP_6:
552                         return Input.Keys.NUM_6;
553                 case GLFW_KEY_KP_7:
554                         return Input.Keys.NUM_7;
555                 case GLFW_KEY_KP_8:
556                         return Input.Keys.NUM_8;
557                 case GLFW_KEY_KP_9:
558                         return Input.Keys.NUM_9;
559                 default:
560                         return Input.Keys.UNKNOWN;
561                 }
562         }
563
564         public static int getJglfwKeyCode (int gdxKeyCode) {
565                 switch (gdxKeyCode) {
566                 case Input.Keys.LEFT_BRACKET:
567                         return GLFW_KEY_LEFT_BRACKET;
568                 case Input.Keys.RIGHT_BRACKET:
569                         return GLFW_KEY_RIGHT_BRACKET;
570                 case Input.Keys.GRAVE:
571                         return GLFW_KEY_GRAVE_ACCENT;
572                 case Input.Keys.STAR:
573                         return GLFW_KEY_KP_MULTIPLY;
574                 case Input.Keys.NUM:
575                         return GLFW_KEY_NUM_LOCK;
576                 case Input.Keys.EQUALS:
577                         return GLFW_KEY_MENU;
578                 case Input.Keys.SYM:
579                         return GLFW_KEY_MENU;
580                 case Input.Keys.NUM_0:
581                         return GLFW_KEY_0;
582                 case Input.Keys.NUM_1:
583                         return GLFW_KEY_1;
584                 case Input.Keys.NUM_2:
585                         return GLFW_KEY_2;
586                 case Input.Keys.NUM_3:
587                         return GLFW_KEY_3;
588                 case Input.Keys.NUM_4:
589                         return GLFW_KEY_4;
590                 case Input.Keys.NUM_5:
591                         return GLFW_KEY_5;
592                 case Input.Keys.NUM_6:
593                         return GLFW_KEY_6;
594                 case Input.Keys.NUM_7:
595                         return GLFW_KEY_7;
596                 case Input.Keys.NUM_8:
597                         return GLFW_KEY_8;
598                 case Input.Keys.NUM_9:
599                         return GLFW_KEY_9;
600                 case Input.Keys.A:
601                         return GLFW_KEY_A;
602                 case Input.Keys.B:
603                         return GLFW_KEY_B;
604                 case Input.Keys.C:
605                         return GLFW_KEY_C;
606                 case Input.Keys.D:
607                         return GLFW_KEY_D;
608                 case Input.Keys.E:
609                         return GLFW_KEY_E;
610                 case Input.Keys.F:
611                         return GLFW_KEY_F;
612                 case Input.Keys.G:
613                         return GLFW_KEY_G;
614                 case Input.Keys.H:
615                         return GLFW_KEY_H;
616                 case Input.Keys.I:
617                         return GLFW_KEY_I;
618                 case Input.Keys.J:
619                         return GLFW_KEY_J;
620                 case Input.Keys.K:
621                         return GLFW_KEY_K;
622                 case Input.Keys.L:
623                         return GLFW_KEY_L;
624                 case Input.Keys.M:
625                         return GLFW_KEY_M;
626                 case Input.Keys.N:
627                         return GLFW_KEY_N;
628                 case Input.Keys.O:
629                         return GLFW_KEY_O;
630                 case Input.Keys.P:
631                         return GLFW_KEY_P;
632                 case Input.Keys.Q:
633                         return GLFW_KEY_Q;
634                 case Input.Keys.R:
635                         return GLFW_KEY_R;
636                 case Input.Keys.S:
637                         return GLFW_KEY_S;
638                 case Input.Keys.T:
639                         return GLFW_KEY_T;
640                 case Input.Keys.U:
641                         return GLFW_KEY_U;
642                 case Input.Keys.V:
643                         return GLFW_KEY_V;
644                 case Input.Keys.W:
645                         return GLFW_KEY_W;
646                 case Input.Keys.X:
647                         return GLFW_KEY_X;
648                 case Input.Keys.Y:
649                         return GLFW_KEY_Y;
650                 case Input.Keys.Z:
651                         return GLFW_KEY_Z;
652                 case Input.Keys.ALT_LEFT:
653                         return GLFW_KEY_LALT;
654                 case Input.Keys.ALT_RIGHT:
655                         return GLFW_KEY_RALT;
656                 case Input.Keys.BACKSLASH:
657                         return GLFW_KEY_BACKSLASH;
658                 case Input.Keys.COMMA:
659                         return GLFW_KEY_COMMA;
660                 case Input.Keys.FORWARD_DEL:
661                         return GLFW_KEY_DELETE;
662                 case Input.Keys.DPAD_LEFT:
663                         return GLFW_KEY_LEFT;
664                 case Input.Keys.DPAD_RIGHT:
665                         return GLFW_KEY_RIGHT;
666                 case Input.Keys.DPAD_UP:
667                         return GLFW_KEY_UP;
668                 case Input.Keys.DPAD_DOWN:
669                         return GLFW_KEY_DOWN;
670                 case Input.Keys.ENTER:
671                         return GLFW_KEY_ENTER;
672                 case Input.Keys.HOME:
673                         return GLFW_KEY_HOME;
674                 case Input.Keys.MINUS:
675                         return GLFW_KEY_MINUS;
676                 case Input.Keys.PERIOD:
677                         return GLFW_KEY_PERIOD;
678                 case Input.Keys.PLUS:
679                         return GLFW_KEY_KP_ADD;
680                 case Input.Keys.SEMICOLON:
681                         return GLFW_KEY_SEMICOLON;
682                 case Input.Keys.SHIFT_LEFT:
683                         return GLFW_KEY_LSHIFT;
684                 case Input.Keys.SHIFT_RIGHT:
685                         return GLFW_KEY_RSHIFT;
686                 case Input.Keys.SLASH:
687                         return GLFW_KEY_SLASH;
688                 case Input.Keys.SPACE:
689                         return GLFW_KEY_SPACE;
690                 case Input.Keys.TAB:
691                         return GLFW_KEY_TAB;
692                 case Input.Keys.DEL:
693                         return GLFW_KEY_BACKSPACE;
694                 case Input.Keys.CONTROL_LEFT:
695                         return GLFW_KEY_LEFT_CONTROL;
696                 case Input.Keys.CONTROL_RIGHT:
697                         return GLFW_KEY_RIGHT_CONTROL;
698                 case Input.Keys.ESCAPE:
699                         return GLFW_KEY_ESCAPE;
700                 case Input.Keys.F1:
701                         return GLFW_KEY_F1;
702                 case Input.Keys.F2:
703                         return GLFW_KEY_F2;
704                 case Input.Keys.F3:
705                         return GLFW_KEY_F3;
706                 case Input.Keys.F4:
707                         return GLFW_KEY_F4;
708                 case Input.Keys.F5:
709                         return GLFW_KEY_F5;
710                 case Input.Keys.F6:
711                         return GLFW_KEY_F6;
712                 case Input.Keys.F7:
713                         return GLFW_KEY_F7;
714                 case Input.Keys.F8:
715                         return GLFW_KEY_F8;
716                 case Input.Keys.F9:
717                         return GLFW_KEY_F9;
718                 case Input.Keys.F10:
719                         return GLFW_KEY_F10;
720                 case Input.Keys.F11:
721                         return GLFW_KEY_F11;
722                 case Input.Keys.F12:
723                         return GLFW_KEY_F12;
724                 default:
725                         return 0;
726                 }
727         }
728 }