| 1 | package com.googlecode.lanterna.input; |
| 2 | |
| 3 | import com.googlecode.lanterna.TerminalPosition; |
| 4 | |
| 5 | /** |
| 6 | * ScreenInfoAction, a KeyStroke in disguise, this class contains the reported position of the screen cursor. |
| 7 | */ |
| 8 | public class ScreenInfoAction extends KeyStroke { |
| 9 | private final TerminalPosition position; |
| 10 | |
| 11 | /** |
| 12 | * Constructs a ScreenInfoAction based on a location on the screen |
| 13 | * @param position the TerminalPosition reported from terminal |
| 14 | */ |
| 15 | public ScreenInfoAction(TerminalPosition position) { |
| 16 | super(KeyType.CursorLocation); |
| 17 | this.position = position; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * The location of the mouse cursor when this event was generated. |
| 22 | * @return Location of the mouse cursor |
| 23 | */ |
| 24 | public TerminalPosition getPosition() { |
| 25 | return position; |
| 26 | } |
| 27 | |
| 28 | @Override |
| 29 | public String toString() { |
| 30 | return "ScreenInfoAction{position=" + position + '}'; |
| 31 | } |
| 32 | } |