aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMidov <midov@midov.pl>2020-11-22 14:17:34 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-22 14:38:07 +0100
commitd58ea43d93fb41519fad6547cf6533d76ecd2441 (patch)
tree7e03d9a11e9a2e61d1967ea32a3112791bc0ae81 /src
parentcb3c9f03e9cd3add0e3eb0c58ebc582fef8d127c (diff)
initial support for ctrl+hjkl movement, redact changed to ctrl+d
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 9a842dc..2eb369c 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -642,9 +642,9 @@ namespace QuickMedia {
sf::FloatRect visible_area(0, 0, window_size.x, window_size.y);
window.setView(sf::View(visible_area));
} else if(handle_keypress && event.type == sf::Event::KeyPressed) {
- if(event.key.code == sf::Keyboard::Up) {
+ if(event.key.code == sf::Keyboard::Up || (event.key.control && event.key.code == sf::Keyboard::K)) {
body->select_previous_item();
- } else if(event.key.code == sf::Keyboard::Down) {
+ } else if(event.key.code == sf::Keyboard::Down || (event.key.control && event.key.code == sf::Keyboard::J)) {
body->select_next_item();
} else if(event.key.code == sf::Keyboard::PageUp) {
body->select_previous_page();
@@ -1132,12 +1132,15 @@ namespace QuickMedia {
if(event.type == sf::Event::Resized || event.type == sf::Event::GainedFocus)
redraw = true;
else if(event.type == sf::Event::KeyPressed) {
- if(event.key.code == sf::Keyboard::Down || event.key.code == sf::Keyboard::PageDown || event.key.code == sf::Keyboard::End) {
+ if(event.key.code == sf::Keyboard::Down || event.key.code == sf::Keyboard::PageDown || event.key.code == sf::Keyboard::End || (event.key.control && event.key.code == sf::Keyboard::J)) {
bool hit_bottom = false;
switch(event.key.code) {
case sf::Keyboard::Down:
hit_bottom = !tabs[selected_tab].body->select_next_item();
break;
+ case sf::Keyboard::J:
+ hit_bottom = !tabs[selected_tab].body->select_next_item();
+ break;
case sf::Keyboard::PageDown:
hit_bottom = !tabs[selected_tab].body->select_next_page();
break;
@@ -1167,7 +1170,7 @@ namespace QuickMedia {
return result_items;
});
}
- } else if(event.key.code == sf::Keyboard::Up) {
+ } else if(event.key.code == sf::Keyboard::Up || (event.key.control && event.key.code == sf::Keyboard::K)) {
tabs[selected_tab].body->select_previous_item();
} else if(event.key.code == sf::Keyboard::PageUp) {
tabs[selected_tab].body->select_previous_page();
@@ -1175,13 +1178,13 @@ namespace QuickMedia {
tabs[selected_tab].body->select_first_item();
} else if(event.key.code == sf::Keyboard::Escape) {
goto page_end;
- } else if(event.key.code == sf::Keyboard::Left) {
+ } else if(event.key.code == sf::Keyboard::Left || (event.key.control && event.key.code == sf::Keyboard::H)) {
if(selected_tab > 0) {
tabs[selected_tab].body->clear_cache();
--selected_tab;
redraw = true;
}
- } else if(event.key.code == sf::Keyboard::Right) {
+ } else if(event.key.code == sf::Keyboard::Right || (event.key.control && event.key.code == sf::Keyboard::L)) {
if(selected_tab < (int)tabs.size() - 1) {
tabs[selected_tab].body->clear_cache();
++selected_tab;
@@ -4072,12 +4075,15 @@ namespace QuickMedia {
} else if(event.type == sf::Event::Resized || event.type == sf::Event::GainedFocus) {
redraw = true;
} else if(event.type == sf::Event::KeyPressed && chat_state == ChatState::NAVIGATING) {
- if(event.key.code == sf::Keyboard::Up || event.key.code == sf::Keyboard::PageUp || event.key.code == sf::Keyboard::Home){
+ if(event.key.code == sf::Keyboard::Up || event.key.code == sf::Keyboard::PageUp || event.key.code == sf::Keyboard::Home || (event.key.control && event.key.code == sf::Keyboard::K)){
bool hit_top = false;
switch(event.key.code) {
case sf::Keyboard::Up:
hit_top = !tabs[selected_tab].body->select_previous_item();
break;
+ case sf::Keyboard::K:
+ hit_top = !tabs[selected_tab].body->select_previous_item();
+ break;
case sf::Keyboard::PageUp:
hit_top = !tabs[selected_tab].body->select_previous_page();
break;
@@ -4098,7 +4104,7 @@ namespace QuickMedia {
return messages;
};
}
- } else if(event.key.code == sf::Keyboard::Down) {
+ } else if(event.key.code == sf::Keyboard::Down || (event.key.control && event.key.code == sf::Keyboard::J)) {
tabs[selected_tab].body->select_next_item();
} else if(event.key.code == sf::Keyboard::PageDown) {
tabs[selected_tab].body->select_next_page();
@@ -4213,7 +4219,7 @@ namespace QuickMedia {
}
}
- if(event.key.code == sf::Keyboard::D) {
+ if(event.key.control && event.key.code == sf::Keyboard::D) {
frame_skip_text_entry = true;
BodyItem *selected = tabs[selected_tab].body->get_selected();
if(selected) {