diff --git a/client/src/core/constants.cc b/client/src/core/constants.cc index 7402dd5..b3ef2c4 100644 --- a/client/src/core/constants.cc +++ b/client/src/core/constants.cc @@ -79,7 +79,8 @@ TN3270_PUBLIC const char * toCharString(const TN3270::Action action) { "break", "deleteword", "deletefield", - "sysreq" + "sysreq", + "kybdunlock" }; if( ((size_t) action) > (sizeof(actions)/sizeof(actions[0]))) { diff --git a/client/src/session/local/actions.cc b/client/src/session/local/actions.cc index d514d7a..b8a1ed7 100644 --- a/client/src/session/local/actions.cc +++ b/client/src/session/local/actions.cc @@ -105,33 +105,34 @@ typedef int (*ActionCallback)(H3270 *); static const ActionCallback actions[] = { - 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 + 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 + lib3270_clear_operator_error, // KYBD_UNLOCK }; if( ((size_t) action) > (sizeof(actions)/sizeof(actions[0]))) { diff --git a/client/src/session/local/private.h b/client/src/session/local/private.h index e3cff81..38c9518 100644 --- a/client/src/session/local/private.h +++ b/client/src/session/local/private.h @@ -130,6 +130,7 @@ unsigned short getScreenHeight() const override; unsigned short getScreenLength() const override; void setUnlockDelay(unsigned short delay) override; + void setLockOnOperatorError(bool lock) override; void setCharSet(const char *charset = NULL) override; void setCursor(unsigned short addr) override; void setCursor(unsigned short row, unsigned short col) override; diff --git a/client/src/session/local/properties.cc b/client/src/session/local/properties.cc index 2c6e6c9..6f19c25 100644 --- a/client/src/session/local/properties.cc +++ b/client/src/session/local/properties.cc @@ -166,6 +166,11 @@ chkResponse(lib3270_set_unlock_delay(hSession,delay)); } + void Local::Session::setLockOnOperatorError(bool lock) { + std::lock_guard guard(sync); + chkResponse(lib3270_set_lock_on_operator_error(hSession,lock ? 1 : 0)); + } + void Local::Session::setCursor(unsigned short addr) { std::lock_guard lock(sync); chkResponse(lib3270_set_cursor_address(hSession,addr)); diff --git a/client/src/session/remote/private.h b/client/src/session/remote/private.h index c396a27..2c7379e 100644 --- a/client/src/session/remote/private.h +++ b/client/src/session/remote/private.h @@ -128,6 +128,7 @@ unsigned short getScreenHeight() const override; unsigned short getScreenLength() const override; void setUnlockDelay(unsigned short delay) override; + void setLockOnOperatorError(bool lock) override; void setCharSet(const char *charset = NULL) override; void setCursor(unsigned short addr) override; void setCursor(unsigned short row, unsigned short col) override; diff --git a/client/src/session/remote/properties.cc b/client/src/session/remote/properties.cc index bc0d126..067d58e 100644 --- a/client/src/session/remote/properties.cc +++ b/client/src/session/remote/properties.cc @@ -133,15 +133,15 @@ } void IPC::Session::setUnlockDelay(unsigned short delay) { - setProperty("unlock_delay", (uint32_t) delay); + } + void IPC::Session::setLockOnOperatorError(bool lock) { + setProperty("oerrlock", (uint32_t) lock); } void IPC::Session::setCursor(unsigned short addr) { - - setProperty("setCursorAddress", (uint32_t) addr); - + setProperty("cursor_address", (uint32_t) addr); } void IPC::Session::setCursor(unsigned short row, unsigned short col) { diff --git a/common/src/include/lib3270/ipc.h b/common/src/include/lib3270/ipc.h index 5e6e372..af61544 100644 --- a/common/src/include/lib3270/ipc.h +++ b/common/src/include/lib3270/ipc.h @@ -216,7 +216,8 @@ 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 + SYSREQ, + KYBD_UNLOCK, ///< @brief Unlock the keyboard if it was locked by operator error. }; /// @brief TN3270 Session. @@ -303,6 +304,7 @@ virtual void setHostURL(const char *url) = 0; virtual void setUnlockDelay(unsigned short delay = 350) = 0; + virtual void setLockOnOperatorError(bool lock = true) = 0; virtual unsigned short getScreenWidth() const = 0; virtual unsigned short getScreenHeight() const = 0; @@ -492,6 +494,10 @@ return session->setUnlockDelay(delay); } + inline void setLockOnOperatorError(bool lock = true) { + return session->setLockOnOperatorError(lock); + } + inline void setCharSet(const char *charset) { return session->setCharSet(charset); } -- libgit2 0.21.2