From 4bd7f27b03bc1834d48c761b193e64c98e0ec924 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 8 Aug 2019 16:14:13 -0300 Subject: [PATCH] Adding support to more actions. --- client/src/session/local/session.cc | 32 +++++++++++++++++++++++++++----- client/src/session/remote/session.cc | 24 +++++++++++++++++++++++- common/src/include/lib3270/ipc.h | 27 +++++++++++++++++++++++++-- 3 files changed, 75 insertions(+), 8 deletions(-) diff --git a/client/src/session/local/session.cc b/client/src/session/local/session.cc index e8bdae6..cbafc86 100644 --- a/client/src/session/local/session.cc +++ b/client/src/session/local/session.cc @@ -258,11 +258,33 @@ typedef int (*ActionCallback)(H3270 *); static const ActionCallback actions[] = { - lib3270_enter, - lib3270_erase, - lib3270_eraseeof, - lib3270_eraseeol, - lib3270_eraseinput + lib3270_enter, // ENTER + lib3270_erase, // ERASE + lib3270_eraseeof, // ERASE_EOF + lib3270_eraseeol, // ERASE_EOL + lib3270_eraseinput, // ERASE_INPUT + lib3270_kybdreset, // KYBD_RESET + lib3270_newline, // NEWLINE + lib3270_clear, // CLEAR + lib3270_select_field, // SELECT_FIELD + lib3270_select_all, // SELECT_ALL + lib3270_unselect, // UNSELECT + lib3270_reselect, // RESELECT + lib3270_delete, // DELETE + lib3270_dup, // DUP + lib3270_fieldmark, // FIELDMARK + lib3270_backspace, // BACKSPACE + lib3270_previousword, // WORD_PREVIOUS + lib3270_nextword, // WORD_NEXT + lib3270_fieldend, // FIELD_END + lib3270_firstfield, // FIELD_FIRST + lib3270_nextfield, // FIELD_NEXT + lib3270_previousfield, // FIELD_PREVIOUS + lib3270_attn, // ATTN + lib3270_break, // BREAK + lib3270_deleteword, // WORD_DELETE + lib3270_deletefield, // FIELD_DELETE + lib3270_sysreq, // SYSREQ }; if( ((size_t) action) > (sizeof(actions)/sizeof(actions[0]))) { diff --git a/client/src/session/remote/session.cc b/client/src/session/remote/session.cc index 070c34d..6a23893 100644 --- a/client/src/session/remote/session.cc +++ b/client/src/session/remote/session.cc @@ -249,12 +249,34 @@ TN3270::Session & IPC::Session::push(const Action action) { - const char * actions[] = { + static const char * actions[] = { "enter", "erase", "eraseeof", "eraseeol", "eraseinput" + "kybdreset", + "newline", + "clear", + "select_field", + "select_all", + "unselect", + "reselect", + "delete", + "dup", + "fieldmark", + "backspace", + "previousword", + "nextword", + "fieldend", + "firstfield", + "nextfield", + "previousfield", + "attn", + "break", + "deleteword", + "deletefield", + "sysreq" }; if( ((size_t) action) > (sizeof(actions)/sizeof(actions[0]))) { diff --git a/common/src/include/lib3270/ipc.h b/common/src/include/lib3270/ipc.h index aa86245..22afcd2 100644 --- a/common/src/include/lib3270/ipc.h +++ b/common/src/include/lib3270/ipc.h @@ -166,11 +166,34 @@ /// @brief Actions keys enum Action : uint8_t { - ENTER, ///< Enter key + ENTER, ///< @brief Enter key ERASE, ERASE_EOF, ERASE_EOL, - ERASE_INPUT + ERASE_INPUT, + KYBD_RESET, + NEWLINE, + CLEAR, + SELECT_FIELD, + SELECT_ALL, + UNSELECT, + RESELECT, + DELETE, + DUP, + FIELDMARK, + BACKSPACE, + WORD_PREVIOUS, + WORD_NEXT, + FIELD_END, ///< @brief Move the cursor to the first blank after the last nonblank in the field. + FIELD_FIRST, ///< @brief Move to first unprotected field on screen. + FIELD_NEXT, + FIELD_PREVIOUS, ///< @brief Tab backward to previous field. + ATTN, ///< @brief ATTN key, per RFC 2355. Sends IP, regardless. + BREAK, + WORD_DELETE, ///< @brief Backspaces the cursor until it hits the front of a word (does a ^W). + FIELD_DELETE, ///< @brief Delete field key (does a ^U). + SYSREQ + }; /// @brief TN3270 Session. -- libgit2 0.21.2