GDDM Tweaking
This commit is contained in:
@@ -453,7 +453,8 @@ public class SettingsDialog extends JDialog {
|
||||
JPanel main = new JPanel(new BorderLayout());
|
||||
|
||||
String[] actions = {"ENTER", "TAB", "shift TAB", "UP", "DOWN", "LEFT", "RIGHT",
|
||||
"HOME", "END", "PAGE_UP", "PAGE_DOWN", "ESCAPE", "INSERT", "DELETE", "BACK_SPACE", "CLEAR"};
|
||||
"HOME", "END", "PAGE_UP", "PAGE_DOWN", "ESCAPE", "INSERT", "DELETE", "BACK_SPACE", "CLEAR",
|
||||
"ERASE_INPUT", "NEWLINE", "DUP", "FIELD_MARK", "ATTN", "SYSREQ", "CURSEL"};
|
||||
|
||||
keymapModel = new DefaultTableModel(new Object[]{"Action", "Key Binding"}, 0) {
|
||||
@Override
|
||||
@@ -465,7 +466,14 @@ public class SettingsDialog extends JDialog {
|
||||
// Populate table from Settings or Defaults
|
||||
for(String act : actions) {
|
||||
String def = act;
|
||||
if(def.equals("PAGE_UP")) def = "PAGE_UP"; // fallback example
|
||||
if (def.equals("ERASE_INPUT")) def = "alt E";
|
||||
else if (def.equals("NEWLINE")) def = "shift ENTER";
|
||||
else if (def.equals("DUP")) def = "alt D";
|
||||
else if (def.equals("FIELD_MARK")) def = "alt M";
|
||||
else if (def.equals("ATTN")) def = "alt A";
|
||||
else if (def.equals("SYSREQ")) def = "alt S";
|
||||
else if (def.equals("CURSEL")) def = "alt Q";
|
||||
else if (def.equals("CLEAR")) def = "alt C";
|
||||
String current = haus.nightmare.j3270.config.Settings.getKeyBinding(act, def);
|
||||
tempKeyBindings.put(act, current);
|
||||
keymapModel.addRow(new Object[]{act, current});
|
||||
|
||||
@@ -259,10 +259,12 @@ public class TerminalPanel extends JPanel {
|
||||
|
||||
int gx = client.getGocaDecoder().getGraphicCursorX();
|
||||
int gy = client.getGocaDecoder().getGraphicCursorY();
|
||||
int hitSeg = client.getGocaDecoder().findPickedSegment(gx, gy);
|
||||
int hitTag = client.getGocaDecoder().getSegmentTag(hitSeg);
|
||||
int button = javax.swing.SwingUtilities.isRightMouseButton(e) ? 2 : 1;
|
||||
System.err.println(String.format(
|
||||
"TerminalPanel.mouseReleased: mouse=(%d, %d) offset=(%d, %d) grid=(%dx%d) px=(%d, %d) goca=(%d, %d) btn=%d",
|
||||
e.getX(), e.getY(), ox, oy, gridW, gridH, px, py, gx, gy, button
|
||||
"TerminalPanel.mouseReleased: mouse=(%d, %d) offset=(%d, %d) grid=(%dx%d) px=(%d, %d) goca=(%d, %d) hitSeg=%d hitTag=%d btn=%d",
|
||||
e.getX(), e.getY(), ox, oy, gridW, gridH, px, py, gx, gy, hitSeg, hitTag, button
|
||||
));
|
||||
|
||||
client.getInputProcessor().sendGraphicMouseAid(
|
||||
@@ -278,10 +280,12 @@ public class TerminalPanel extends JPanel {
|
||||
if (lightPenMode) {
|
||||
clearSelection();
|
||||
sb.setCursorAddress(clickAddr);
|
||||
boolean result = client.getInputProcessor().lightPenSelect(clickAddr);
|
||||
boolean result = client.lightPenSelect(clickAddr);
|
||||
if (result) {
|
||||
refreshScreen();
|
||||
return;
|
||||
} else {
|
||||
Toolkit.getDefaultToolkit().beep();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,6 +612,7 @@ public class TerminalPanel extends JPanel {
|
||||
bindKeyToMap(im, "FIELD_MARK", haus.nightmare.j3270.config.Settings.getKeyBinding("FIELD_MARK", "alt M"));
|
||||
bindKeyToMap(im, "ATTN", haus.nightmare.j3270.config.Settings.getKeyBinding("ATTN", "alt A"));
|
||||
bindKeyToMap(im, "SYSREQ", haus.nightmare.j3270.config.Settings.getKeyBinding("SYSREQ", "alt S"));
|
||||
bindKeyToMap(im, "CURSEL", haus.nightmare.j3270.config.Settings.getKeyBinding("CURSEL", "alt Q"));
|
||||
|
||||
// Copy/Paste bindings — Cmd+C / Cmd+V (macOS) or Ctrl+C / Ctrl+V (others)
|
||||
int shortcutMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx();
|
||||
@@ -638,6 +643,7 @@ public class TerminalPanel extends JPanel {
|
||||
am.put("j3270-FIELD_MARK", createAction(this::handleFieldMark));
|
||||
am.put("j3270-ATTN", createAction(this::handleAttn));
|
||||
am.put("j3270-SYSREQ", createAction(this::handleSysReq));
|
||||
am.put("j3270-CURSEL", createAction(this::handleCursorSelect));
|
||||
|
||||
// Copy/Paste actions
|
||||
am.put("j3270-COPY", createAction(this::copySelection));
|
||||
@@ -824,6 +830,17 @@ public class TerminalPanel extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleCursorSelect() {
|
||||
if (client != null && client.getConnectionState().isFullSession()) {
|
||||
boolean selected = client.cursorSelect();
|
||||
if (selected) {
|
||||
refreshScreen();
|
||||
} else {
|
||||
Toolkit.getDefaultToolkit().beep();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshScreen() {
|
||||
if (client != null) {
|
||||
client.getScreenBuffer().updateDisplaySnapshot();
|
||||
|
||||
Reference in New Issue
Block a user