public String getSelectedText(FieldRange range) {
		synchronized (lock) {
			FieldLocation start = range.getStart();
			int startRow = start.getIndex().intValueExact();
			int startCol = start.getCol();

			FieldLocation end = range.getEnd();
			int endRow = end.getIndex().intValueExact();
			int endCol = end.getCol();

			return buffer.getText(startRow, startCol, endRow, endCol, System.lineSeparator());
		}
	}
This will be difficult to implement in Swing/AWT, since the OS and Java will already have
mapped the key, including incorporating the NUMLOCK state. Ignore until it matters.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/terminal/TerminalLayoutModel.java