Fixed broken Ctrl and Shift toolbar buttons
This commit is contained in:
@@ -1165,24 +1165,35 @@ static CallBackFunction ToolbarSwitchClick(Window *w)
|
|||||||
static CallBackFunction ToolbarCtrlClick(Window *w)
|
static CallBackFunction ToolbarCtrlClick(Window *w)
|
||||||
{
|
{
|
||||||
_ctrl_pressed = !_ctrl_pressed;
|
_ctrl_pressed = !_ctrl_pressed;
|
||||||
|
//DEBUG(misc, 1, "ToolbarCtrlClick: pressed %d", _ctrl_pressed);
|
||||||
w->SetWidgetLoweredState(WID_TN_CTRL, _ctrl_pressed);
|
w->SetWidgetLoweredState(WID_TN_CTRL, _ctrl_pressed);
|
||||||
HandleCtrlChanged();
|
|
||||||
w->SetWidgetDirty(WID_TN_CTRL);
|
w->SetWidgetDirty(WID_TN_CTRL);
|
||||||
|
HandleCtrlChanged();
|
||||||
EraseQueuedTouchCommand();
|
EraseQueuedTouchCommand();
|
||||||
|
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CallBackFunction ToolbarShiftClick(Window *w)
|
static CallBackFunction ToolbarShiftClick(Window *w)
|
||||||
{
|
{
|
||||||
_shift_pressed = !_shift_pressed;
|
_shift_pressed = !_shift_pressed;
|
||||||
|
//DEBUG(misc, 1, "ToolbarShiftClick: pressed %d", _shift_pressed);
|
||||||
w->SetWidgetLoweredState(WID_TN_SHIFT, _shift_pressed);
|
w->SetWidgetLoweredState(WID_TN_SHIFT, _shift_pressed);
|
||||||
w->SetWidgetDirty(WID_TN_SHIFT);
|
w->SetWidgetDirty(WID_TN_SHIFT);
|
||||||
|
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CallBackFunction ToolbarDeleteClick(Window *w)
|
static CallBackFunction ToolbarDeleteClick(Window *w)
|
||||||
{
|
{
|
||||||
DeleteNonVitalWindows();
|
DeleteNonVitalWindows();
|
||||||
|
_ctrl_pressed = false;
|
||||||
|
w->SetWidgetLoweredState(WID_TN_CTRL, _ctrl_pressed);
|
||||||
|
w->SetWidgetDirty(WID_TN_CTRL);
|
||||||
|
_shift_pressed = false;
|
||||||
|
w->SetWidgetLoweredState(WID_TN_SHIFT, _shift_pressed);
|
||||||
|
w->SetWidgetDirty(WID_TN_SHIFT);
|
||||||
|
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -761,10 +761,12 @@ void VideoDriver_SDL::MainLoop()
|
|||||||
|
|
||||||
bool old_ctrl_pressed = _ctrl_pressed;
|
bool old_ctrl_pressed = _ctrl_pressed;
|
||||||
|
|
||||||
|
#ifndef __ANDROID__
|
||||||
if (_settings_client.gui.touchscreen_mode == TSC_NONE) {
|
if (_settings_client.gui.touchscreen_mode == TSC_NONE) {
|
||||||
_ctrl_pressed = !!(mod & KMOD_CTRL);
|
_ctrl_pressed = !!(mod & KMOD_CTRL);
|
||||||
_shift_pressed = !!(mod & KMOD_SHIFT);
|
_shift_pressed = !!(mod & KMOD_SHIFT);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* determine which directional keys are down */
|
/* determine which directional keys are down */
|
||||||
_dirkeys =
|
_dirkeys =
|
||||||
|
|||||||
Reference in New Issue
Block a user