X-Git-Url: https://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fcom%2Fgooglecode%2Flanterna%2Finput%2FScreenInfoCharacterPattern.java;fp=src%2Fcom%2Fgooglecode%2Flanterna%2Finput%2FScreenInfoCharacterPattern.java;h=0000000000000000000000000000000000000000;hb=f06c81000632cfb5f525ca458f719338f55f9f66;hp=99bcfd85424f929e26bc2bf1e895d20a0f78e390;hpb=a73a906356c971b080c36368e71a15d87e8b8d31;p=jvcard.git diff --git a/src/com/googlecode/lanterna/input/ScreenInfoCharacterPattern.java b/src/com/googlecode/lanterna/input/ScreenInfoCharacterPattern.java deleted file mode 100644 index 99bcfd8..0000000 --- a/src/com/googlecode/lanterna/input/ScreenInfoCharacterPattern.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of lanterna (http://code.google.com/p/lanterna/). - * - * lanterna is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * Copyright (C) 2010-2015 Martin - */ -package com.googlecode.lanterna.input; - -import com.googlecode.lanterna.TerminalPosition; - -/** - * This class recognizes character combinations which are actually a cursor position report. See - * Wikipedia's article on ANSI escape codes for more - * information about how cursor position reporting works ("DSR – Device Status Report"). - * - * @author Martin, Andreas - */ -public class ScreenInfoCharacterPattern extends EscapeSequenceCharacterPattern { - public ScreenInfoCharacterPattern() { - useEscEsc = false; // stdMap and finMap don't matter here. - } - protected KeyStroke getKeyStrokeRaw(char first,int num1,int num2,char last,boolean bEsc) { - if (first != '[' || last != 'R' || num1 == 0 || num2 == 0 || bEsc) { - return null; // nope - } - if (num1 == 1 && num2 <= 8) { - return null; // nope: much more likely it's an F3 with modifiers - } - TerminalPosition pos = new TerminalPosition(num2, num1); - return new ScreenInfoAction(pos); // yep - } - - public static ScreenInfoAction tryToAdopt(KeyStroke ks) { - switch (ks.getKeyType()) { - case CursorLocation: return (ScreenInfoAction)ks; - case F3: // reconstruct position from F3's modifiers. - int col = 1 + (ks.isAltDown() ? ALT : 0) - + (ks.isCtrlDown() ? CTRL : 0) - + (ks.isShiftDown()? SHIFT: 0); - TerminalPosition pos = new TerminalPosition(col,1); - return new ScreenInfoAction(pos); - default: return null; - } - } - - -}