diff --git a/src/include/lib3270.h b/src/include/lib3270.h index 3b119db..bbc9bbe 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -468,6 +468,8 @@ */ LIB3270_EXPORT int lib3270_set_string(H3270 *h, const unsigned char *str); + LIB3270_EXPORT void lib3270_input_string(H3270 *hSession, const unsigned char *str); + /** * Set cursor address. * diff --git a/src/lib3270/kybd.c b/src/lib3270/kybd.c index 1462fba..41eb6bd 100644 --- a/src/lib3270/kybd.c +++ b/src/lib3270/kybd.c @@ -70,6 +70,7 @@ struct ta; #include "popupsc.h" // #include "printc.h" #include "screenc.h" +#include "screen.h" // #if defined(X3270_DISPLAY) /*[*/ // #include "selectc.h" // #endif /*]*/ @@ -735,8 +736,6 @@ static void key_Character_wrapper(H3270 *hSession, const char *param1, const cha code &= ~PASTE_WFLAG; } -// lib3270_trace_event(hSession," %s -> Key(%s\"%s\")\n",ia_name[(int) ia_cause],with_ge ? "GE " : "",ctl_see((int) ebc2asc[code])); - (void) key_Character(hSession, code, with_ge, pasting, NULL); } @@ -987,6 +986,18 @@ static Boolean key_Character(H3270 *hSession, int code, Boolean with_ge, Boolean return True; } + +LIB3270_EXPORT void lib3270_input_string(H3270 *hSession, const unsigned char *str) +{ + while(*str) + { + key_ACharacter(hSession,(unsigned char)((*str) & 0xff), KT_STD, IA_KEY, NULL); + str++; + } + + screen_update(hSession,0,hSession->rows*hSession->cols); +} + /** * Handle an ordinary character key, given an ASCII code. * @@ -996,7 +1007,7 @@ void key_ACharacter(H3270 *hSession, unsigned char c, enum keytype keytype, enum if (skipped != NULL) *skipped = False; - lib3270_trace_event(hSession," %s -> Key(\"%s\")\n",ia_name[(int) cause], ctl_see((int) c)); + lib3270_trace_event(hSession," %s -> Key(\"%s\") Hex(%02x)\n",ia_name[(int) cause], ctl_see((int) c), (int) c); if (IN_3270) { diff --git a/src/pw3270/v3270/keyboard.c b/src/pw3270/v3270/keyboard.c index bac54cb..8250100 100644 --- a/src/pw3270/v3270/keyboard.c +++ b/src/pw3270/v3270/keyboard.c @@ -261,7 +261,8 @@ if(utf) { - lib3270_set_string(GTK_V3270(widget)->host, (const unsigned char *) utf); + lib3270_input_string(GTK_V3270(widget)->host, (const unsigned char *) utf); +// lib3270_set_string(GTK_V3270(widget)->host, (const unsigned char *) utf); g_free(utf); } else -- libgit2 0.21.2