mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2025-01-22 00:11:20 +00:00
clear modifier keys on focus change
This commit is contained in:
parent
fcab743f4a
commit
9240214c7b
1 changed files with 10 additions and 2 deletions
|
@ -315,7 +315,7 @@ qbool rawmouse_t::Init()
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
XSelectInput( dpy, win, KeyPressMask | KeyReleaseMask );
|
XSelectInput( dpy, win, KeyPressMask | KeyReleaseMask | FocusChangeMask );
|
||||||
|
|
||||||
return qtrue;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
@ -624,7 +624,7 @@ static int mouse_threshold;
|
||||||
|
|
||||||
#define KEY_MASK (KeyPressMask | KeyReleaseMask)
|
#define KEY_MASK (KeyPressMask | KeyReleaseMask)
|
||||||
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ButtonMotionMask )
|
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ButtonMotionMask )
|
||||||
#define X_MASK (KEY_MASK | MOUSE_MASK | VisibilityChangeMask | StructureNotifyMask )
|
#define X_MASK (KEY_MASK | MOUSE_MASK | VisibilityChangeMask | StructureNotifyMask | FocusChangeMask )
|
||||||
cvar_t* in_nograb;
|
cvar_t* in_nograb;
|
||||||
|
|
||||||
|
|
||||||
|
@ -783,6 +783,14 @@ static void HandleEvents()
|
||||||
Sys_QueEvent( 0, SE_KEY, key, qfalse, 0, NULL );
|
Sys_QueEvent( 0, SE_KEY, key, qfalse, 0, NULL );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FocusIn:
|
||||||
|
case FocusOut:
|
||||||
|
// reset all modifiers on focus change
|
||||||
|
Sys_QueEvent( 0, SE_KEY, K_ALT, qfalse, 0, NULL );
|
||||||
|
Sys_QueEvent( 0, SE_KEY, K_CTRL, qfalse, 0, NULL );
|
||||||
|
Sys_QueEvent( 0, SE_KEY, K_SHIFT, qfalse, 0, NULL );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue