fd0eedef2537bedff59628ee26ce52ecee924f9e
2 * Jexer - Java Text User Interface
6 * Author: Kevin Lamonte, <a href="mailto:kevin.lamonte@gmail.com">kevin.lamonte@gmail.com</a>
8 * License: LGPLv3 or later
10 * Copyright: This module is licensed under the GNU Lesser General
11 * Public License Version 3. Please see the file "COPYING" in this
12 * directory for more information about the GNU Lesser General Public
15 * Copyright (C) 2015 Kevin Lamonte
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public License
19 * as published by the Free Software Foundation; either version 3 of
20 * the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful, but
23 * WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * General Public License for more details.
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with this program; if not, see
29 * http://www.gnu.org/licenses/, or write to the Free Software
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
36 * This class encapsulates several kinds of mouse input events.
38 public class TMouseEvent
extends TInputEvent
{
42 * Mouse motion. X and Y will have screen coordinates.
47 * Mouse button down. X and Y will have screen coordinates.
52 * Mouse button up. X and Y will have screen coordinates.
58 * Type of event, one of MOUSE_MOTION, MOUSE_UP, or MOUSE_DOWN, or
64 * Mouse X - relative coordinates
69 * Mouse Y - relative coordinates
74 * Mouse X - absolute screen coordinates
79 * Mouse Y - absolute screen coordinate
84 * Mouse button 1 (left button)
86 public boolean mouse1
;
89 * Mouse button 2 (right button)
91 public boolean mouse2
;
94 * Mouse button 3 (middle button)
96 public boolean mouse3
;
99 * Mouse wheel UP (button 4)
101 public boolean mouseWheelUp
;
104 * Mouse wheel DOWN (button 5)
106 public boolean mouseWheelDown
;
111 * @param type the type of event, MOUSE_MOTION, MOUSE_DOWN, or MOUSE_UP
113 public TMouseEvent(Type type
) {
118 * Make human-readable description of this event
121 public String
toString() {
122 return String
.format("Mouse: %s x %d y %d absoluteX %d absoluteY %d 1 %s 2 %s 3 %s DOWN %s UP %s",
125 absoluteX
, absoluteY
,