Commit 175a47309b968e02d82cb67306edb81c4a0bf9cf
1 parent
4ba96013
Exists in
master
and in
5 other branches
Mudando tratamento das entradas de teclado para melhorar a performance
Showing
3 changed files
with
18 additions
and
4 deletions
Show diff stats
src/include/lib3270.h
@@ -468,6 +468,8 @@ | @@ -468,6 +468,8 @@ | ||
468 | */ | 468 | */ |
469 | LIB3270_EXPORT int lib3270_set_string(H3270 *h, const unsigned char *str); | 469 | LIB3270_EXPORT int lib3270_set_string(H3270 *h, const unsigned char *str); |
470 | 470 | ||
471 | + LIB3270_EXPORT void lib3270_input_string(H3270 *hSession, const unsigned char *str); | ||
472 | + | ||
471 | /** | 473 | /** |
472 | * Set cursor address. | 474 | * Set cursor address. |
473 | * | 475 | * |
src/lib3270/kybd.c
@@ -70,6 +70,7 @@ struct ta; | @@ -70,6 +70,7 @@ struct ta; | ||
70 | #include "popupsc.h" | 70 | #include "popupsc.h" |
71 | // #include "printc.h" | 71 | // #include "printc.h" |
72 | #include "screenc.h" | 72 | #include "screenc.h" |
73 | +#include "screen.h" | ||
73 | // #if defined(X3270_DISPLAY) /*[*/ | 74 | // #if defined(X3270_DISPLAY) /*[*/ |
74 | // #include "selectc.h" | 75 | // #include "selectc.h" |
75 | // #endif /*]*/ | 76 | // #endif /*]*/ |
@@ -735,8 +736,6 @@ static void key_Character_wrapper(H3270 *hSession, const char *param1, const cha | @@ -735,8 +736,6 @@ static void key_Character_wrapper(H3270 *hSession, const char *param1, const cha | ||
735 | code &= ~PASTE_WFLAG; | 736 | code &= ~PASTE_WFLAG; |
736 | } | 737 | } |
737 | 738 | ||
738 | -// lib3270_trace_event(hSession," %s -> Key(%s\"%s\")\n",ia_name[(int) ia_cause],with_ge ? "GE " : "",ctl_see((int) ebc2asc[code])); | ||
739 | - | ||
740 | (void) key_Character(hSession, code, with_ge, pasting, NULL); | 739 | (void) key_Character(hSession, code, with_ge, pasting, NULL); |
741 | } | 740 | } |
742 | 741 | ||
@@ -987,6 +986,18 @@ static Boolean key_Character(H3270 *hSession, int code, Boolean with_ge, Boolean | @@ -987,6 +986,18 @@ static Boolean key_Character(H3270 *hSession, int code, Boolean with_ge, Boolean | ||
987 | return True; | 986 | return True; |
988 | } | 987 | } |
989 | 988 | ||
989 | + | ||
990 | +LIB3270_EXPORT void lib3270_input_string(H3270 *hSession, const unsigned char *str) | ||
991 | +{ | ||
992 | + while(*str) | ||
993 | + { | ||
994 | + key_ACharacter(hSession,(unsigned char)((*str) & 0xff), KT_STD, IA_KEY, NULL); | ||
995 | + str++; | ||
996 | + } | ||
997 | + | ||
998 | + screen_update(hSession,0,hSession->rows*hSession->cols); | ||
999 | +} | ||
1000 | + | ||
990 | /** | 1001 | /** |
991 | * Handle an ordinary character key, given an ASCII code. | 1002 | * Handle an ordinary character key, given an ASCII code. |
992 | * | 1003 | * |
@@ -996,7 +1007,7 @@ void key_ACharacter(H3270 *hSession, unsigned char c, enum keytype keytype, enum | @@ -996,7 +1007,7 @@ void key_ACharacter(H3270 *hSession, unsigned char c, enum keytype keytype, enum | ||
996 | if (skipped != NULL) | 1007 | if (skipped != NULL) |
997 | *skipped = False; | 1008 | *skipped = False; |
998 | 1009 | ||
999 | - lib3270_trace_event(hSession," %s -> Key(\"%s\")\n",ia_name[(int) cause], ctl_see((int) c)); | 1010 | + lib3270_trace_event(hSession," %s -> Key(\"%s\") Hex(%02x)\n",ia_name[(int) cause], ctl_see((int) c), (int) c); |
1000 | 1011 | ||
1001 | if (IN_3270) | 1012 | if (IN_3270) |
1002 | { | 1013 | { |
src/pw3270/v3270/keyboard.c
@@ -261,7 +261,8 @@ | @@ -261,7 +261,8 @@ | ||
261 | 261 | ||
262 | if(utf) | 262 | if(utf) |
263 | { | 263 | { |
264 | - lib3270_set_string(GTK_V3270(widget)->host, (const unsigned char *) utf); | 264 | + lib3270_input_string(GTK_V3270(widget)->host, (const unsigned char *) utf); |
265 | +// lib3270_set_string(GTK_V3270(widget)->host, (const unsigned char *) utf); | ||
265 | g_free(utf); | 266 | g_free(utf); |
266 | } | 267 | } |
267 | else | 268 | else |