pawelchcki / semicomplete

Automatically exported from code.google.com/p/semicomplete
0 stars 0 forks source link

ShiftMask not reset #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. In an xterm terminal enter:

    xdotool type Hello

What is the expected output? What do you see instead?
Expected: Hello
What I got: HELLO

What version of the product are you using? On what operating system?
xdotool release 20090609, Linux

Please provide any additional information below.

Knee jerk fix (means that I don't know if this is the best  solution):

diff --git a/xdo.c b/xdo.c
index 095a577..6a6d0be 100644
--- a/xdo.c
+++ b/xdo.c
@@ -577,6 +577,8 @@ int xdo_type(xdo_t *xdo, Window window, char *string,
useconds_t delay) {

     if (shiftcode > 0) {
       modstate |= ShiftMask;
+    } else {
+      modstate &= ~ShiftMask;
     }

     _xdo_send_key(xdo, window, keycode, modstate, True, delay);
@@ -606,6 +608,8 @@ int _xdo_keysequence_do(xdo_t *xdo, Window window, char
*keyseq, int pressed) {
   for (i = 0; i < nkeys; i++) {
     if (keys[i].shift > 0) {
       modstate |= ShiftMask;
+    } else {
+      modstate &= ~ShiftMask;
     }

     _xdo_send_key(xdo, window, keys[i].code, modstate, pressed, 0);

Original issue reported on code.google.com by ayieh...@gmail.com on 12 Jun 2009 at 8:01

GoogleCodeExporter commented 9 years ago
The version 20080720 does not have this problem.

Original comment by pierre.t...@gmail.com on 13 Jun 2009 at 4:06

GoogleCodeExporter commented 9 years ago
I'll poke at this and push a fix. Thanks for the bug report! :)

Original comment by jls.semi...@gmail.com on 13 Jun 2009 at 4:09

GoogleCodeExporter commented 9 years ago
Bug confirmed.

Original comment by jls.semi...@gmail.com on 13 Jun 2009 at 6:20

GoogleCodeExporter commented 9 years ago

Original comment by jls.semi...@gmail.com on 14 Jun 2009 at 3:29