diff --git a/po/pt_BR.po b/po/pt_BR.po index 6a26f3b..7c1a33a 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-09-20 17:26-0300\n" +"POT-Creation-Date: 2012-09-20 18:39-0300\n" "PO-Revision-Date: 2012-09-20 17:33-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português \n" diff --git a/src/lib3270/kybd.c b/src/lib3270/kybd.c index c2a57af..1462fba 100644 --- a/src/lib3270/kybd.c +++ b/src/lib3270/kybd.c @@ -2628,11 +2628,11 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *hSession, const char *s, int len break; case '[': /* APL left bracket */ - key_ACharacter(hSession,(unsigned char) c, KT_STD, ia, &skipped); + key_ACharacter(hSession,(unsigned char) c, KT_STD, ia, &skipped); break; case ']': /* APL right bracket */ - key_ACharacter(hSession,(unsigned char) c, KT_STD, ia, &skipped); + key_ACharacter(hSession,(unsigned char) c, KT_STD, ia, &skipped); break; default: diff --git a/src/plugins/remotectl/remotectl.c b/src/plugins/remotectl/remotectl.c index 2835724..a13289f 100644 --- a/src/plugins/remotectl/remotectl.c +++ b/src/plugins/remotectl/remotectl.c @@ -35,11 +35,16 @@ #include #include #include + #include #include #include /*--[ Implement ]------------------------------------------------------------------------------------*/ + static const gchar control_char = '@'; + +/*--[ Implement ]------------------------------------------------------------------------------------*/ + #ifdef WIN32 void popup_lasterror(const gchar *fmt, ...) @@ -176,11 +181,85 @@ g_get_charset(&charset); - text = g_convert(buffer,-1,lib3270_get_charset(hSession),charset,&bytes_read,&bytes_written,&error); + text = g_convert(buffer,length,lib3270_get_charset(hSession),charset,&bytes_read,&bytes_written,&error); if(text) { - #warning Converter "@" em "\\" - lib3270_emulate_input(hSession,text,strlen(text),0); + if(strchr(text,control_char)) + { + // Convert control char + gchar * buffer = text; + char * ptr; + + for(ptr = strchr(text,control_char);ptr;ptr = strchr(buffer,control_char)) + { + *(ptr++) = 0; + + lib3270_emulate_input(hSession,buffer,-1,0); + + switch(*(ptr++)) + { + case 'E': // Enter + lib3270_enter(hSession); + break; + + case '1': // PF1 + lib3270_pfkey(hSession,1); + break; + + case '2': // PF2 + lib3270_pfkey(hSession,2); + break; + + case '3': // PF3 + lib3270_pfkey(hSession,3); + break; + + case '4': // PF4 + lib3270_pfkey(hSession,4); + break; + + case '5': // PF5 + lib3270_pfkey(hSession,5); + break; + + case '6': // PF6 + lib3270_pfkey(hSession,6); + break; + + case '7': // PF7 + lib3270_pfkey(hSession,7); + break; + + case '8': // PF8 + lib3270_pfkey(hSession,8); + break; + + case '9': // PF9 + lib3270_pfkey(hSession,9); + break; + + case 'a': // PF10 + lib3270_pfkey(hSession,10); + break; + + case 'b': // PF11 + lib3270_pfkey(hSession,11); + break; + + case 'c': // PF12 + lib3270_pfkey(hSession,12); + break; + } + + } + + lib3270_emulate_input(hSession,buffer,-1,0); + + } + else + { + lib3270_emulate_input(hSession,text,strlen(text),0); + } g_free(text); rc = 0; } -- libgit2 0.21.2