2 * Sixth 3D engine. Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public License
6 * or later as published by the Free Software Foundation.
10 package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
12 import java.util.HashSet;
15 public class KeyboardHelper {
17 public static final int TAB = 9;
18 public static final int DOWN = 40;
19 public static final int UP = 38;
20 public static final int RIGHT = 39;
21 public static final int LEFT = 37;
22 public static final int PGDOWN = 34;
23 public static final int PGUP = 33;
24 public static final int HOME = 36;
25 public static final int END = 35;
26 public static final int DEL = 127;
27 public static final int ENTER = 10;
28 public static final int BACKSPACE = 8;
29 public static final int ESC = 27;
30 public static final int SHIFT = 16;
32 private static final Set<Integer> nonText;
35 nonText = new HashSet<>();
45 public static boolean isAlt(final int modifiers) {
46 return (modifiers | 8) == modifiers;
49 public static boolean isCtrl(final int modifiers) {
50 return (modifiers | 2) == modifiers;
53 public static boolean isShift(final int modifiers) {
54 return (modifiers | 1) == modifiers;
57 public static boolean isText(final int keyCode) {
58 return !nonText.contains(keyCode);