Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing KeyRelease events when multiple keys are depressed. #547

Merged
merged 2 commits into from Jan 19, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 13 additions & 10 deletions platforms/unix/vm-display-X11/sqUnixX11.c
Expand Up @@ -373,8 +373,17 @@ static char *defaultWindowLabel = shortImageName;
static long launchDropTimeoutMsecs = 1000; /* 1 second default launch drop timeout */

/* Value of last key pressed indexed by KeyCode in the range 8 - 255 */
static int lastKeyValue[256];

static int lastKeyValue[]=
{
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
};

/*** Functions ***/

Expand Down Expand Up @@ -1719,20 +1728,14 @@ static int recordPendingKeys(void)

storeLastKeyValue(XKeyEvent *xevt, int value)
{
static int initialized= 0;
if (!initialized)
{
for (int i= 0; i<256; i++) lastKeyValue[i]= -1;
initialized= -1;
}
lastKeyValue[xevt->keycode]= value;
lastKeyValue[xevt->keycode & 0xff]= value;
return value;
}

int retrieveLastKeyValue(XKeyEvent *xevt)
{
int value= lastKeyValue[xevt->keycode];
lastKeyValue[xevt->keycode]= -1;
lastKeyValue[xevt->keycode & 0xff]= -1;
return value;
}

Expand Down