Keyboard plugin issue
Posted: Sun May 24, 2015 8:05 pm
I ran into an issue with the Keyboard plugin when multiple keys are pressed.
The case is something like this:
1. I have an active handler for Keyboard.A in the tree.
2. Press space
3. Press A
4. Release space
When you do that, you start getting "a" events sent to the active window, which I would not expect to happen, since there's an active handler for Window.A (if you just press the A key, you won't get "a" events sent to the active window).
The reason this happens is that after you release the space key, the next key event that comes in is the repeat for "A", and in InsertKey in keyhook.c, there is this bit of code:
The A key is already in the array. The problem is the return FALSE, which causes KeyboardProc() to call the next hook instead of calling the Python handler.
I believe just changing the return FALSE to return TRUE should fix this.
Where is EventGhost's code currently hosted? Can I submit a pull request somewhere for this issue?
Thanks!
The case is something like this:
1. I have an active handler for Keyboard.A in the tree.
2. Press space
3. Press A
4. Release space
When you do that, you start getting "a" events sent to the active window, which I would not expect to happen, since there's an active handler for Window.A (if you just press the A key, you won't get "a" events sent to the active window).
The reason this happens is that after you release the space key, the next key event that comes in is the repeat for "A", and in InsertKey in keyhook.c, there is this bit of code:
Code: Select all
if (khData.pressedKeys[i] == key)
{
// They key is already in. This should never happen, but it happens
return FALSE;
}
I believe just changing the return FALSE to return TRUE should fix this.
Where is EventGhost's code currently hosted? Can I submit a pull request somewhere for this issue?
Thanks!