Commit 4bd7f27b03bc1834d48c761b193e64c98e0ec924
1 parent
24a346b5
Exists in
master
and in
1 other branch
Adding support to more actions.
Showing
3 changed files
with
75 additions
and
8 deletions
Show diff stats
client/src/session/local/session.cc
| @@ -258,11 +258,33 @@ | @@ -258,11 +258,33 @@ | ||
| 258 | typedef int (*ActionCallback)(H3270 *); | 258 | typedef int (*ActionCallback)(H3270 *); |
| 259 | 259 | ||
| 260 | static const ActionCallback actions[] = { | 260 | static const ActionCallback actions[] = { |
| 261 | - lib3270_enter, | ||
| 262 | - lib3270_erase, | ||
| 263 | - lib3270_eraseeof, | ||
| 264 | - lib3270_eraseeol, | ||
| 265 | - lib3270_eraseinput | 261 | + lib3270_enter, // ENTER |
| 262 | + lib3270_erase, // ERASE | ||
| 263 | + lib3270_eraseeof, // ERASE_EOF | ||
| 264 | + lib3270_eraseeol, // ERASE_EOL | ||
| 265 | + lib3270_eraseinput, // ERASE_INPUT | ||
| 266 | + lib3270_kybdreset, // KYBD_RESET | ||
| 267 | + lib3270_newline, // NEWLINE | ||
| 268 | + lib3270_clear, // CLEAR | ||
| 269 | + lib3270_select_field, // SELECT_FIELD | ||
| 270 | + lib3270_select_all, // SELECT_ALL | ||
| 271 | + lib3270_unselect, // UNSELECT | ||
| 272 | + lib3270_reselect, // RESELECT | ||
| 273 | + lib3270_delete, // DELETE | ||
| 274 | + lib3270_dup, // DUP | ||
| 275 | + lib3270_fieldmark, // FIELDMARK | ||
| 276 | + lib3270_backspace, // BACKSPACE | ||
| 277 | + lib3270_previousword, // WORD_PREVIOUS | ||
| 278 | + lib3270_nextword, // WORD_NEXT | ||
| 279 | + lib3270_fieldend, // FIELD_END | ||
| 280 | + lib3270_firstfield, // FIELD_FIRST | ||
| 281 | + lib3270_nextfield, // FIELD_NEXT | ||
| 282 | + lib3270_previousfield, // FIELD_PREVIOUS | ||
| 283 | + lib3270_attn, // ATTN | ||
| 284 | + lib3270_break, // BREAK | ||
| 285 | + lib3270_deleteword, // WORD_DELETE | ||
| 286 | + lib3270_deletefield, // FIELD_DELETE | ||
| 287 | + lib3270_sysreq, // SYSREQ | ||
| 266 | }; | 288 | }; |
| 267 | 289 | ||
| 268 | if( ((size_t) action) > (sizeof(actions)/sizeof(actions[0]))) { | 290 | if( ((size_t) action) > (sizeof(actions)/sizeof(actions[0]))) { |
client/src/session/remote/session.cc
| @@ -249,12 +249,34 @@ | @@ -249,12 +249,34 @@ | ||
| 249 | 249 | ||
| 250 | TN3270::Session & IPC::Session::push(const Action action) { | 250 | TN3270::Session & IPC::Session::push(const Action action) { |
| 251 | 251 | ||
| 252 | - const char * actions[] = { | 252 | + static const char * actions[] = { |
| 253 | "enter", | 253 | "enter", |
| 254 | "erase", | 254 | "erase", |
| 255 | "eraseeof", | 255 | "eraseeof", |
| 256 | "eraseeol", | 256 | "eraseeol", |
| 257 | "eraseinput" | 257 | "eraseinput" |
| 258 | + "kybdreset", | ||
| 259 | + "newline", | ||
| 260 | + "clear", | ||
| 261 | + "select_field", | ||
| 262 | + "select_all", | ||
| 263 | + "unselect", | ||
| 264 | + "reselect", | ||
| 265 | + "delete", | ||
| 266 | + "dup", | ||
| 267 | + "fieldmark", | ||
| 268 | + "backspace", | ||
| 269 | + "previousword", | ||
| 270 | + "nextword", | ||
| 271 | + "fieldend", | ||
| 272 | + "firstfield", | ||
| 273 | + "nextfield", | ||
| 274 | + "previousfield", | ||
| 275 | + "attn", | ||
| 276 | + "break", | ||
| 277 | + "deleteword", | ||
| 278 | + "deletefield", | ||
| 279 | + "sysreq" | ||
| 258 | }; | 280 | }; |
| 259 | 281 | ||
| 260 | if( ((size_t) action) > (sizeof(actions)/sizeof(actions[0]))) { | 282 | if( ((size_t) action) > (sizeof(actions)/sizeof(actions[0]))) { |
common/src/include/lib3270/ipc.h
| @@ -166,11 +166,34 @@ | @@ -166,11 +166,34 @@ | ||
| 166 | 166 | ||
| 167 | /// @brief Actions keys | 167 | /// @brief Actions keys |
| 168 | enum Action : uint8_t { | 168 | enum Action : uint8_t { |
| 169 | - ENTER, ///< Enter key | 169 | + ENTER, ///< @brief Enter key |
| 170 | ERASE, | 170 | ERASE, |
| 171 | ERASE_EOF, | 171 | ERASE_EOF, |
| 172 | ERASE_EOL, | 172 | ERASE_EOL, |
| 173 | - ERASE_INPUT | 173 | + ERASE_INPUT, |
| 174 | + KYBD_RESET, | ||
| 175 | + NEWLINE, | ||
| 176 | + CLEAR, | ||
| 177 | + SELECT_FIELD, | ||
| 178 | + SELECT_ALL, | ||
| 179 | + UNSELECT, | ||
| 180 | + RESELECT, | ||
| 181 | + DELETE, | ||
| 182 | + DUP, | ||
| 183 | + FIELDMARK, | ||
| 184 | + BACKSPACE, | ||
| 185 | + WORD_PREVIOUS, | ||
| 186 | + WORD_NEXT, | ||
| 187 | + FIELD_END, ///< @brief Move the cursor to the first blank after the last nonblank in the field. | ||
| 188 | + FIELD_FIRST, ///< @brief Move to first unprotected field on screen. | ||
| 189 | + FIELD_NEXT, | ||
| 190 | + FIELD_PREVIOUS, ///< @brief Tab backward to previous field. | ||
| 191 | + ATTN, ///< @brief ATTN key, per RFC 2355. Sends IP, regardless. | ||
| 192 | + BREAK, | ||
| 193 | + WORD_DELETE, ///< @brief Backspaces the cursor until it hits the front of a word (does a ^W). | ||
| 194 | + FIELD_DELETE, ///< @brief Delete field key (does a ^U). | ||
| 195 | + SYSREQ | ||
| 196 | + | ||
| 174 | }; | 197 | }; |
| 175 | 198 | ||
| 176 | /// @brief TN3270 Session. | 199 | /// @brief TN3270 Session. |