Add modifier key window for toggling shift/ctrl key states using mouse

This commit is contained in:
Jonathan G Rennison
2019-09-05 23:21:41 +01:00
parent f681e98f0f
commit b3431512ee
14 changed files with 147 additions and 13 deletions

View File

@@ -728,9 +728,10 @@ void VideoDriver_SDL::MainLoop()
next_tick = cur_ticks + MILLISECONDS_PER_TICK;
bool old_ctrl_pressed = _ctrl_pressed;
bool old_shift_pressed = _shift_pressed;
_ctrl_pressed = !!(mod & KMOD_CTRL);
_shift_pressed = !!(mod & KMOD_SHIFT);
_ctrl_pressed = !!(mod & KMOD_CTRL) != _invert_ctrl;
_shift_pressed = !!(mod & KMOD_SHIFT) != _invert_shift;
/* determine which directional keys are down */
_dirkeys =
@@ -746,6 +747,7 @@ void VideoDriver_SDL::MainLoop()
(keys[SDLK_DOWN] ? 8 : 0);
#endif
if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
if (old_shift_pressed != _shift_pressed) HandleShiftChanged();
/* The gameloop is the part that can run asynchronously. The rest
* except sleeping can't. */