09ace1da0d97a20ff925857ad0b288c5b1be34e4
2 * Jexer - Java Text User Interface
4 * License: LGPLv3 or later
6 * This module is licensed under the GNU Lesser General Public License
7 * Version 3. Please see the file "COPYING" in this directory for more
8 * information about the GNU Lesser General Public License Version 3.
10 * Copyright (C) 2015 Kevin Lamonte
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public License
14 * as published by the Free Software Foundation; either version 3 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this program; if not, see
24 * http://www.gnu.org/licenses/, or write to the Free Software
25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
28 * @author Kevin Lamonte [kevin.lamonte@gmail.com]
34 * This class encapsulates several kinds of mouse input events.
36 public class TMouseEvent
extends TInputEvent
{
39 * The type of event generated.
43 * Mouse motion. X and Y will have screen coordinates.
48 * Mouse button down. X and Y will have screen coordinates.
53 * Mouse button up. X and Y will have screen coordinates.
59 * Type of event, one of MOUSE_MOTION, MOUSE_UP, or MOUSE_DOWN, or
65 * Mouse X - relative coordinates.
70 * Mouse Y - relative coordinates.
75 * Mouse X - absolute screen coordinates.
80 * Mouse Y - absolute screen coordinate.
85 * Mouse button 1 (left button).
87 public boolean mouse1
;
90 * Mouse button 2 (right button).
92 public boolean mouse2
;
95 * Mouse button 3 (middle button).
97 public boolean mouse3
;
100 * Mouse wheel UP (button 4).
102 public boolean mouseWheelUp
;
105 * Mouse wheel DOWN (button 5).
107 public boolean mouseWheelDown
;
112 * @param type the type of event, MOUSE_MOTION, MOUSE_DOWN, or MOUSE_UP
114 public TMouseEvent(final Type type
) {
119 * Make human-readable description of this TMouseEvent.
121 * @return displayable String
124 public final String
toString() {
125 return String
.format("Mouse: %s x %d y %d absoluteX %d absoluteY %d 1 %s 2 %s 3 %s DOWN %s UP %s",
128 absoluteX
, absoluteY
,