First working implementation with special characters handled by unicodekeyboardevents.
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
This commit is contained in:
parent
12d7353fb7
commit
4d0ed19243
File diff suppressed because it is too large
Load Diff
@ -59,6 +59,7 @@
|
|||||||
#include "rdp_keymap.h"
|
#include "rdp_keymap.h"
|
||||||
#include "rdp_cliprdr.h"
|
#include "rdp_cliprdr.h"
|
||||||
#include "guac_handlers.h"
|
#include "guac_handlers.h"
|
||||||
|
#include "unicode_convtable.h"
|
||||||
|
|
||||||
void __guac_rdp_update_keysyms(guac_client* client, const int* keysym_string, int from, int to);
|
void __guac_rdp_update_keysyms(guac_client* client, const int* keysym_string, int from, int to);
|
||||||
int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed);
|
int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed);
|
||||||
@ -349,6 +350,8 @@ int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed) {
|
|||||||
| (pressed ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE),
|
| (pressed ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE),
|
||||||
keysym_desc->scancode);
|
keysym_desc->scancode);
|
||||||
|
|
||||||
|
guac_client_log_info(client, "Base flags are %d", keysym_desc->flags);
|
||||||
|
|
||||||
/* If defined, release any keys that were originally released */
|
/* If defined, release any keys that were originally released */
|
||||||
if (keysym_desc->set_keysyms != NULL)
|
if (keysym_desc->set_keysyms != NULL)
|
||||||
__guac_rdp_update_keysyms(client, keysym_desc->set_keysyms, 0, 0);
|
__guac_rdp_update_keysyms(client, keysym_desc->set_keysyms, 0, 0);
|
||||||
@ -357,23 +360,39 @@ int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed) {
|
|||||||
if (keysym_desc->clear_keysyms != NULL)
|
if (keysym_desc->clear_keysyms != NULL)
|
||||||
__guac_rdp_update_keysyms(client, keysym_desc->clear_keysyms, 1, 1);
|
__guac_rdp_update_keysyms(client, keysym_desc->clear_keysyms, 1, 1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* /\* If undefined but has Alt-code, use Alt-Code *\/ */
|
||||||
|
/* else if (keysym <= 0xFF) { */
|
||||||
|
|
||||||
|
/* /\* NOTE: The Alt-codes are conveniently identical to keysyms. *\/ */
|
||||||
|
|
||||||
|
/* /\* Only send Alt-code on press *\/ */
|
||||||
|
/* if (pressed) */
|
||||||
|
/* __guac_rdp_send_altcode(client, keysym); */
|
||||||
|
|
||||||
|
/* } */
|
||||||
|
|
||||||
|
/* /\* If no defined Alt-code, log warning *\/ */
|
||||||
|
/* else */
|
||||||
|
/* guac_client_log_info(client, "unmapped keysym: 0x%x", keysym); */
|
||||||
|
|
||||||
|
} else {
|
||||||
|
/* Fall back to unicode events */
|
||||||
|
int unicode_code = keysym2uni(keysym);
|
||||||
|
guac_client_log_info(client, "Translated keysym:0x%x to unicode:0x%x (pressed=%d flag=%d)",
|
||||||
|
keysym, unicode_code, pressed, pressed ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE);
|
||||||
|
|
||||||
|
/* LibfreeRDP seems not to take into account the DOWN/RELEASE flags.
|
||||||
|
* So we send only the key once.
|
||||||
|
*/
|
||||||
|
if (pressed) {
|
||||||
|
rdp_inst->input->UnicodeKeyboardEvent(
|
||||||
|
rdp_inst->input,
|
||||||
|
0,//pressed ? KBD_FLAGS_DOW : KBD_FLAGS_RELEASE,
|
||||||
|
unicode_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If undefined but has Alt-code, use Alt-Code */
|
|
||||||
else if (keysym <= 0xFF) {
|
|
||||||
|
|
||||||
/* NOTE: The Alt-codes are conveniently identical to keysyms. */
|
|
||||||
|
|
||||||
/* Only send Alt-code on press */
|
|
||||||
if (pressed)
|
|
||||||
__guac_rdp_send_altcode(client, keysym);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If no defined Alt-code, log warning */
|
|
||||||
else
|
|
||||||
guac_client_log_info(client, "unmapped keysym: 0x%x", keysym);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user