Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
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, 4008👍, 0💬
Popular Posts:
How to perform XML Schema validation with sax\Writer.java provided in the Apache Xerces package? You...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
What Is jms.jar? I heard it's related to JMS (Java Message Service) 1.1? The if you have an jms.jar ...
JDK 11 jdk.jshell.jmod is the JMOD file for JDK 11 JShell tool, which can be invoked by the "jshell"...
Apache Log4j SLF4J Binding allows applications coded to the SLF4J API to use Log4j 2 as the implemen...