| 1 | /* |
| 2 | * This file is part of lanterna (http://code.google.com/p/lanterna/). |
| 3 | * |
| 4 | * lanterna is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Lesser General Public License as published by |
| 6 | * the Free Software Foundation, either version 3 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public License |
| 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | * |
| 17 | * Copyright (C) 2010-2015 Martin |
| 18 | */ |
| 19 | package com.googlecode.lanterna.input; |
| 20 | |
| 21 | |
| 22 | /** |
| 23 | * This enum is a categorization of the various keys available on a normal computer keyboard that are usable |
| 24 | * (detectable) by a terminal environment. For ordinary numbers, letters and symbols, the enum value is <i>Character</i> |
| 25 | * but please keep in mind that newline and tab, usually represented by \n and \t, are considered their own separate |
| 26 | * values by this enum (<i>Enter</i> and <i>Tab</i>). |
| 27 | * <p> |
| 28 | * Previously (before Lanterna 3.0), this enum was embedded inside the Key class. |
| 29 | * |
| 30 | * @author Martin |
| 31 | */ |
| 32 | public enum KeyType { |
| 33 | /** |
| 34 | * This value corresponds to a regular character 'typed', usually alphanumeric or a symbol. The one special case |
| 35 | * here is the enter key which could be expected to be returned as a '\n' character but is actually returned as a |
| 36 | * separate {@code KeyType} (see below). Tab, backspace and some others works this way too. |
| 37 | */ |
| 38 | Character, |
| 39 | Escape, |
| 40 | Backspace, |
| 41 | ArrowLeft, |
| 42 | ArrowRight, |
| 43 | ArrowUp, |
| 44 | ArrowDown, |
| 45 | Insert, |
| 46 | Delete, |
| 47 | Home, |
| 48 | End, |
| 49 | PageUp, |
| 50 | PageDown, |
| 51 | Tab, |
| 52 | ReverseTab, |
| 53 | Enter, |
| 54 | F1, |
| 55 | F2, |
| 56 | F3, |
| 57 | F4, |
| 58 | F5, |
| 59 | F6, |
| 60 | F7, |
| 61 | F8, |
| 62 | F9, |
| 63 | F10, |
| 64 | F11, |
| 65 | F12, |
| 66 | F13, |
| 67 | F14, |
| 68 | F15, |
| 69 | F16, |
| 70 | F17, |
| 71 | F18, |
| 72 | F19, |
| 73 | Unknown, |
| 74 | |
| 75 | //"Virtual" KeyStroke types |
| 76 | /** |
| 77 | * This value is only internally within Lanterna to understand where the cursor currently is, it's not expected to |
| 78 | * be returned by the API to an input read call. |
| 79 | */ |
| 80 | CursorLocation, |
| 81 | /** |
| 82 | * This type is not really a key stroke but actually a 'catch-all' for mouse related events. Please note that mouse |
| 83 | * event capturing must first be enabled and many terminals don't suppose this extension at all. |
| 84 | */ |
| 85 | MouseEvent, |
| 86 | /** |
| 87 | * This value is returned when you try to read input and the input stream has been closed. |
| 88 | */ |
| 89 | EOF, |
| 90 | ; |
| 91 | } |