From 5515eb8465ad89c83200fe9dcecad89d3c37227f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 5 Jun 2021 17:42:08 +0200 Subject: Change alt to ctrl for tab movement --- src/SearchBar.cpp | 2 +- src/Tabs.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp index bf58c34..a54fc5d 100644 --- a/src/SearchBar.cpp +++ b/src/SearchBar.cpp @@ -122,7 +122,7 @@ namespace QuickMedia { time_since_search_update.restart(); } - if(sf::Keyboard::isKeyPressed(sf::Keyboard::LAlt) || sf::Keyboard::isKeyPressed(sf::Keyboard::RAlt)) + if(sf::Keyboard::isKeyPressed(sf::Keyboard::LControl) || sf::Keyboard::isKeyPressed(sf::Keyboard::RControl)) return; if(event.type == sf::Event::TextEntered && event.text.unicode != 8 && event.text.unicode != 127) // 8 = backspace, 127 = del diff --git a/src/Tabs.cpp b/src/Tabs.cpp index 390b088..6b8d948 100644 --- a/src/Tabs.cpp +++ b/src/Tabs.cpp @@ -61,11 +61,11 @@ namespace QuickMedia { } void Tabs::on_event(sf::Event &event) { - if(event.type == sf::Event::KeyPressed && !tabs.empty()) { - bool move_left = event.key.alt && (event.key.code == sf::Keyboard::Left || (event.key.control && event.key.code == sf::Keyboard::H)); + if(event.type == sf::Event::KeyPressed && event.key.control && !tabs.empty()) { + bool move_left = (event.key.code == sf::Keyboard::Left || event.key.code == sf::Keyboard::H); move_left |= (event.key.code == sf::Keyboard::Tab && event.key.shift); - bool move_right = event.key.alt && (event.key.code == sf::Keyboard::Right || (event.key.control && event.key.code == sf::Keyboard::L)); + bool move_right = (event.key.code == sf::Keyboard::Right || event.key.code == sf::Keyboard::L); move_right |= (event.key.code == sf::Keyboard::Tab && !event.key.shift); if(move_left) { @@ -74,7 +74,7 @@ namespace QuickMedia { } else if(move_right) { if(selected_tab < (int)tabs.size() - 1) move_selected_tab(selected_tab + 1); - } else if(event.key.alt && event.key.code >= sf::Keyboard::Num1 && event.key.code <= sf::Keyboard::Num9) { + } else if(event.key.code >= sf::Keyboard::Num1 && event.key.code <= sf::Keyboard::Num9) { const int tab_target = event.key.code - sf::Keyboard::Num1; if(tab_target < (int)tabs.size()) move_selected_tab(tab_target); -- cgit v1.2.3