summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsorg71 <jay.sorg@gmail.com>2014-05-19 12:29:13 -0700
committerjsorg71 <jay.sorg@gmail.com>2014-05-19 12:29:13 -0700
commiteaa801f1342550134e0feace4f1c2d0ab2041099 (patch)
tree04d96274e92bbb8a03cd5efc30e41aedbd7cd013
parentff61d8c6fff13ca06d818e353b90aa847db39858 (diff)
parentf748345ea0942642c58eb3a8deb93f11d184d8da (diff)
downloadxrdp-proprietary-eaa801f1342550134e0feace4f1c2d0ab2041099.tar.gz
xrdp-proprietary-eaa801f1342550134e0feace4f1c2d0ab2041099.zip
Merge pull request #127 from ArvidNorr/numlock
Numlock out of sync fix
-rw-r--r--neutrinordp/xrdp-neutrinordp.c25
-rw-r--r--neutrinordp/xrdp-neutrinordp.h2
2 files changed, 23 insertions, 4 deletions
diff --git a/neutrinordp/xrdp-neutrinordp.c b/neutrinordp/xrdp-neutrinordp.c
index 3602e57c..997a0c0c 100644
--- a/neutrinordp/xrdp-neutrinordp.c
+++ b/neutrinordp/xrdp-neutrinordp.c
@@ -27,7 +27,7 @@
#ifdef XRDP_DEBUG
#define LOG_LEVEL 99
#else
-#define LOG_LEVEL 10
+#define LOG_LEVEL 0
#endif
#define LLOG(_level, _args) \
@@ -195,14 +195,31 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
switch (msg)
{
case 15: /* key down */
+ // Before we handle the first character we synchronize
+ // capslock and numlock.
+ // We collect the state during the first synchronize ( see msg 17)
+ if(!mod->bool_keyBoardSynced)
+ {
+ LLOGLN(0, ("Additional Sync event handled : %d",mod->keyBoardLockInfo));
+ mod->inst->input->SynchronizeEvent(mod->inst->input, mod->keyBoardLockInfo);
+ mod->bool_keyBoardSynced = 1;
+ }
mod->inst->input->KeyboardEvent(mod->inst->input, param4, param3);
break;
case 16: /* key up */
mod->inst->input->KeyboardEvent(mod->inst->input, param4, param3);
break;
- case 17: /*Synchronize*/
- LLOGLN(11, ("Synchronized event handled"));
- mod->inst->input->SynchronizeEvent(mod->inst->input, 0);
+ case 17: /*Synchronize*/
+ LLOGLN(11, ("Synchronized event handled : %d",param1));
+ // In some situations the Synchronize event come to early.
+ // Therefore we store this information and use it when we
+ // receive the first keyboard event
+ // Without this fix numlock and capslock can come out of sync.
+ mod->inst->input->SynchronizeEvent(mod->inst->input, param1);
+ if(!mod->bool_keyBoardSynced)
+ {
+ mod->keyBoardLockInfo = param1 ;
+ }
break;
case 100: /* mouse move */
LLOGLN(12, ("mouse move %d %d", param1, param2));
diff --git a/neutrinordp/xrdp-neutrinordp.h b/neutrinordp/xrdp-neutrinordp.h
index 9cd3a8c3..e09c0419 100644
--- a/neutrinordp/xrdp-neutrinordp.h
+++ b/neutrinordp/xrdp-neutrinordp.h
@@ -172,6 +172,8 @@ struct mod
int vrev;
char username[256];
char password[256];
+ int bool_keyBoardSynced ; /*Numlock can be out of sync, we hold state here to resolve */
+ int keyBoardLockInfo ; /* Holds initial numlock capslock state */
struct xrdp_client_info client_info;