Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.internal.le.jmod - Internal Line Editing Module
JDK 17 jdk.internal.le.jmod is the JMOD file for JDK 17 Internal Line Editing module.
JDK 17 Internal Line Editing module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.internal.le.jmod.
JDK 17 Internal Line Editing module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Internal Line Editing module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.internal.le.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/org/jline/terminal/impl/MouseSupport.java
/*
* Copyright (c) 2002-2016, the original author or authors.
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.terminal.impl;
import jdk.internal.org.jline.terminal.MouseEvent;
import jdk.internal.org.jline.terminal.Terminal;
import jdk.internal.org.jline.utils.InfoCmp;
import jdk.internal.org.jline.utils.InputStreamReader;
import java.io.EOFException;
import java.io.IOError;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.EnumSet;
import java.util.function.IntSupplier;
public class MouseSupport {
public static boolean hasMouseSupport(Terminal terminal) {
return terminal.getStringCapability(InfoCmp.Capability.key_mouse) != null;
}
public static boolean trackMouse(Terminal terminal, Terminal.MouseTracking tracking) {
if (hasMouseSupport(terminal)) {
switch (tracking) {
case Off:
terminal.writer().write("\033[?1000l");
break;
case Normal:
terminal.writer().write("\033[?1005h\033[?1000h");
break;
case Button:
terminal.writer().write("\033[?1005h\033[?1002h");
break;
case Any:
terminal.writer().write("\033[?1005h\033[?1003h");
break;
}
terminal.flush();
return true;
} else {
return false;
}
}
public static MouseEvent readMouse(Terminal terminal, MouseEvent last) {
return readMouse(() -> readExt(terminal), last);
}
public static MouseEvent readMouse(IntSupplier reader, MouseEvent last) {
int cb = reader.getAsInt() - ' ';
int cx = reader.getAsInt() - ' ' - 1;
int cy = reader.getAsInt() - ' ' - 1;
MouseEvent.Type type;
MouseEvent.Button button;
EnumSet<MouseEvent.Modifier> modifiers = EnumSet.noneOf(MouseEvent.Modifier.class);
if ((cb & 4) == 4) {
modifiers.add(MouseEvent.Modifier.Shift);
}
if ((cb & 8) == 8) {
modifiers.add(MouseEvent.Modifier.Alt);
}
if ((cb & 16) == 16) {
modifiers.add(MouseEvent.Modifier.Control);
}
if ((cb & 64) == 64) {
type = MouseEvent.Type.Wheel;
button = (cb & 1) == 1 ? MouseEvent.Button.WheelDown : MouseEvent.Button.WheelUp;
} else {
int b = (cb & 3);
switch (b) {
case 0:
button = MouseEvent.Button.Button1;
if (last.getButton() == button
&& (last.getType() == MouseEvent.Type.Pressed || last.getType() == MouseEvent.Type.Dragged)) {
type = MouseEvent.Type.Dragged;
} else {
type = MouseEvent.Type.Pressed;
}
break;
case 1:
button = MouseEvent.Button.Button2;
if (last.getButton() == button
&& (last.getType() == MouseEvent.Type.Pressed || last.getType() == MouseEvent.Type.Dragged)) {
type = MouseEvent.Type.Dragged;
} else {
type = MouseEvent.Type.Pressed;
}
break;
case 2:
button = MouseEvent.Button.Button3;
if (last.getButton() == button
&& (last.getType() == MouseEvent.Type.Pressed || last.getType() == MouseEvent.Type.Dragged)) {
type = MouseEvent.Type.Dragged;
} else {
type = MouseEvent.Type.Pressed;
}
break;
default:
if (last.getType() == MouseEvent.Type.Pressed || last.getType() == MouseEvent.Type.Dragged) {
button = last.getButton();
type = MouseEvent.Type.Released;
} else {
button = MouseEvent.Button.NoButton;
type = MouseEvent.Type.Moved;
}
break;
}
}
return new MouseEvent(type, button, modifiers, cx, cy);
}
private static int readExt(Terminal terminal) {
try {
// The coordinates are encoded in UTF-8, so if that's not the input encoding,
// we need to get around
int c;
if (terminal.encoding() != StandardCharsets.UTF_8) {
c = new InputStreamReader(terminal.input(), StandardCharsets.UTF_8).read();
} else {
c = terminal.reader().read();
}
if (c < 0) {
throw new EOFException();
}
return c;
} catch (IOException e) {
throw new IOError(e);
}
}
}
⏎ jdk/internal/org/jline/terminal/impl/MouseSupport.java
Or download all of them as a single archive file:
File name: jdk.internal.le-17.0.5-src.zip File size: 231458 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.internal.opt.jmod - Internal Opt Module
⇐ JDK 17 jdk.internal.jvmstat.jmod - Internal JVM Stat Module
2023-08-25, ≈19🔥, 0💬
Popular Posts:
commons-fileupload-1.3.3 -sources.jaris the source JAR file for Apache Commons FileUpload 1.3., whic...
maven-embedder-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Embedder module. Apache Maven is a s...
Java Cryptography Extension 1.2.2 JAR File Size and Download Location: File name: jce.jar, jce-1.2.2...
How to display types defined in an XML Schema file with the xs\QueryXS.java provided in the Apache X...
JDK 11 java.security.jgss.jmod is the JMOD file for JDK 11 Security JGSS (Java Generic Security Serv...