Skip to content

Commit

Permalink
Fixed some combinations with right shift/control not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Loobinex committed Aug 19, 2024
1 parent 6b615f2 commit 6b6be9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/front_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ TbBool get_dungeon_control_pausable_action_inputs(void)
struct Camera* cam = &player->cameras[CamIV_Isometric];
struct Packet* pckt = get_packet(my_player_number);
int angle = cam->orient_a;
if (lbKeyOn[KC_LCONTROL])
if (key_modifiers & KMod_CONTROL)
{
if ((angle >= 0 && angle < 256) || angle == 2048)
{
Expand Down Expand Up @@ -1110,7 +1110,7 @@ TbBool get_dungeon_control_pausable_action_inputs(void)
angle = 0;
}
}
else if (lbKeyOn[KC_LSHIFT])
else if (key_modifiers & KMod_SHIFT)
{
if (angle > 0 && angle <= 256)
{angle = 2048;}
Expand Down Expand Up @@ -1167,11 +1167,11 @@ TbBool get_dungeon_control_pausable_action_inputs(void)
struct Camera* cam = &player->cameras[CamIV_FrontView];
struct Packet* pckt = get_packet(my_player_number);
int angle = cam->orient_a;
if (lbKeyOn[KC_LCONTROL])
if (key_modifiers & KMod_CONTROL)
{
set_packet_control(pckt, PCtr_ViewRotateCW);
}
else if (lbKeyOn[KC_LSHIFT])
else if (key_modifiers & KMod_SHIFT)
{
set_packet_control(pckt, PCtr_ViewRotateCCW);
}
Expand Down Expand Up @@ -1941,7 +1941,7 @@ int global_frameskipTurn = 0;
void get_isometric_or_front_view_mouse_inputs(struct Packet *pckt,int rotate_pressed,int speed_pressed)
{
// Reserve the scroll wheel for the resurrect and transfer creature specials
if ((menu_is_active(GMnu_RESURRECT_CREATURE) || menu_is_active(GMnu_TRANSFER_CREATURE) || lbKeyOn[KC_LSHIFT] || lbKeyOn[KC_LCONTROL]) == 0)
if ((menu_is_active(GMnu_RESURRECT_CREATURE) || menu_is_active(GMnu_TRANSFER_CREATURE) || (key_modifiers & KMod_SHIFT) || (key_modifiers & KMod_CONTROL)) == 0)
{
// mouse scroll zoom unaffected by frameskip
if ((pckt->control_flags & PCtr_MapCoordsValid) != 0)
Expand All @@ -1956,7 +1956,7 @@ void get_isometric_or_front_view_mouse_inputs(struct Packet *pckt,int rotate_pre
}
}
}
if (menu_is_active(GMnu_BATTLE) && lbKeyOn[KC_LCONTROL])
if (menu_is_active(GMnu_BATTLE) && (key_modifiers & KMod_CONTROL))
{
if (wheel_scrolled_up)
{
Expand Down
4 changes: 2 additions & 2 deletions src/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ void maintain_scroll_up(struct GuiButton *gbtn)
gbtn->flags ^= (gbtn->flags ^ LbBtnF_Enabled * (scrollwnd->start_y < 0)) & LbBtnF_Enabled;
if (!check_current_gui_layer(GuiLayer_OneClick))
{
if (wheel_scrolled_up & lbKeyOn[KC_LCONTROL])
if (wheel_scrolled_up & (lbKeyOn[KC_LCONTROL] || lbKeyOn[KC_RCONTROL]))
{
scrollwnd->action = 1;
}
Expand All @@ -880,7 +880,7 @@ void maintain_scroll_down(struct GuiButton *gbtn)
* (scrollwnd->window_height - scrollwnd->text_height + 2 < scrollwnd->start_y)) & LbBtnF_Enabled;
if (!check_current_gui_layer(GuiLayer_OneClick))
{
if (wheel_scrolled_down & lbKeyOn[KC_LCONTROL])
if (wheel_scrolled_down & (lbKeyOn[KC_LCONTROL] || lbKeyOn[KC_RCONTROL]))
{
scrollwnd->action = 2;
}
Expand Down
6 changes: 3 additions & 3 deletions src/frontmenu_ingame_tabs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ void maintain_activity_up(struct GuiButton *gbtn)
gbtn->flags |= LbBtnF_Visible;
gbtn->flags ^= (gbtn->flags ^ LbBtnF_Enabled * (top_of_breed_list > 0)) & LbBtnF_Enabled;
}
if (wheel_scrolled_up & lbKeyOn[KC_LSHIFT])
if (wheel_scrolled_up & (lbKeyOn[KC_LSHIFT]|| lbKeyOn[KC_RSHIFT]))
{
if (top_of_breed_list > 0)
{
Expand All @@ -1817,7 +1817,7 @@ void maintain_activity_down(struct GuiButton *gbtn)
gbtn->flags |= LbBtnF_Visible;
gbtn->flags ^= (gbtn->flags ^ LbBtnF_Enabled * (no_of_breeds_owned - 6 > top_of_breed_list)) & LbBtnF_Enabled;
}
if (wheel_scrolled_down & lbKeyOn[KC_LSHIFT])
if (wheel_scrolled_down & (lbKeyOn[KC_LSHIFT] || lbKeyOn[KC_RSHIFT]))
{
if (top_of_breed_list + 6 < no_of_breeds_owned)
{
Expand Down Expand Up @@ -1997,7 +1997,7 @@ void maintain_event_button(struct GuiButton *gbtn)
{
// Fight icon flashes when there are fights to show
gbtn->sprite_idx += 2;
if(is_game_key_pressed(Gkey_ZoomToFight, &keycode, true) && lbKeyOn[KC_LSHIFT])
if(is_game_key_pressed(Gkey_ZoomToFight, &keycode, true) && (key_modifiers & KMod_SHIFT))
{
if ((evidx == dungeon->visible_event_idx))
{
Expand Down

0 comments on commit 6b6be9e

Please sign in to comment.