From 9cf0eca825a3dfe8d88105711f739f450b5bb2b5 Mon Sep 17 00:00:00 2001 From: hrexed Date: Mon, 7 Oct 2019 14:49:23 +0200 Subject: [PATCH] better support of Arrows keys --- .../neotys/rte/TerminalEmulator/SendTextActionEngine.java | 2 +- .../rte/TerminalEmulator/ch/SpecialKeysConverter.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/neotys/rte/TerminalEmulator/SendTextActionEngine.java b/src/main/java/com/neotys/rte/TerminalEmulator/SendTextActionEngine.java index 626729a..e254243 100644 --- a/src/main/java/com/neotys/rte/TerminalEmulator/SendTextActionEngine.java +++ b/src/main/java/com/neotys/rte/TerminalEmulator/SendTextActionEngine.java @@ -107,7 +107,7 @@ public SampleResult execute(Context context, List parameters) { { sampleResult.sampleStart(); - final String output = channel.sendKeys(Key, TimeOut,NoWaitForEcho,ClearBufferBefore); + final String output = channel. sendKeys(Key, TimeOut,NoWaitForEcho,ClearBufferBefore); sampleResult.sampleEnd(); appendLineToStringBuilder(responseBuilder, output); diff --git a/src/main/java/com/neotys/rte/TerminalEmulator/ch/SpecialKeysConverter.java b/src/main/java/com/neotys/rte/TerminalEmulator/ch/SpecialKeysConverter.java index f046c77..8fd9256 100644 --- a/src/main/java/com/neotys/rte/TerminalEmulator/ch/SpecialKeysConverter.java +++ b/src/main/java/com/neotys/rte/TerminalEmulator/ch/SpecialKeysConverter.java @@ -187,13 +187,13 @@ public SpecialKeys apply(final String specialKeys) { switch (specialKeys.toUpperCase()) { case UP: - return SpecialKeys.of(Ascii.ESC, "[A".getBytes()); + return SpecialKeys.of(Ascii.ESC, "OA".getBytes()); case DOWN: - return SpecialKeys.of(Ascii.ESC, "[B".getBytes()); + return SpecialKeys.of(Ascii.ESC, "OB".getBytes()); case LEFT: - return SpecialKeys.of(Ascii.ESC, "[D".getBytes()); + return SpecialKeys.of(Ascii.ESC, "OD".getBytes()); case RIGHT: - return SpecialKeys.of(Ascii.ESC, "[C".getBytes()); + return SpecialKeys.of(Ascii.ESC, "OC".getBytes()); default: return SpecialKeys.of(Ascii.ESC); }