2 * Sixth 3D engine. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
5 package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
7 import java.util.HashSet;
10 public class KeyboardHelper {
12 public static final int TAB = 9;
13 public static final int DOWN = 40;
14 public static final int UP = 38;
15 public static final int RIGHT = 39;
16 public static final int LEFT = 37;
17 public static final int PGDOWN = 34;
18 public static final int PGUP = 33;
19 public static final int HOME = 36;
20 public static final int END = 35;
21 public static final int DEL = 127;
22 public static final int ENTER = 10;
23 public static final int BACKSPACE = 8;
24 public static final int ESC = 27;
25 public static final int SHIFT = 16;
27 private static final Set<Integer> nonText;
30 nonText = new HashSet<>();
40 public static boolean isAlt(final int modifiers) {
41 return (modifiers | 8) == modifiers;
44 public static boolean isCtrl(final int modifiers) {
45 return (modifiers | 2) == modifiers;
48 public static boolean isShift(final int modifiers) {
49 return (modifiers | 1) == modifiers;
52 public static boolean isText(final int keyCode) {
53 return !nonText.contains(keyCode);