summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2015-08-27 07:43:40 +0200
committerArno <arno@disconnect.de>2015-08-27 07:43:40 +0200
commitf9ac7497ec0e0412385611b2722261ebb367a5e0 (patch)
treed27bdebd46f8517bd8c7ac4c0abd088f11dc9e9c
parent488aa1707651c20eeada7c724b44874dba1ba011 (diff)
downloadSheMov-f9ac7497ec0e0412385611b2722261ebb367a5e0.tar.gz
SheMov-f9ac7497ec0e0412385611b2722261ebb367a5e0.tar.bz2
SheMov-f9ac7497ec0e0412385611b2722261ebb367a5e0.zip
Fix keyboard triggers
Call the appropriate functions on keyPressEvent
-rw-r--r--pictureviewer2.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/pictureviewer2.cpp b/pictureviewer2.cpp
index 93bb148..898ee81 100644
--- a/pictureviewer2.cpp
+++ b/pictureviewer2.cpp
@@ -468,15 +468,39 @@ void PictureViewer2::contextMenuEvent(QContextMenuEvent *e){
}
void PictureViewer2::keyPressEvent(QKeyEvent *e){
+ Qt::KeyboardModifiers mod = e->modifiers();
+ if(mod & Qt::ControlModifier){
+ if(e->key() == Qt::Key_Down || e->key() == Qt::Key_Right){
+ skip(25);
+ }
+ if(e->key() == Qt::Key_Up || e->key() == Qt::Key_Left){
+ skip(-25);
+ }
+ if(e->key() == Qt::Key_Space){
+ if(mCurTimer->isActive()){
+ stopSlide();
+ }else{
+ startSlideAll();
+ }
+ }
+ return;
+ }
+
if(e->key() == Qt::Key_Escape){
+ stopSlide();
mHideA->toggle();
}
if(e->key() == Qt::Key_Space){
- mToggleSlideA->toggle();
+ if(mCurTimer->isActive()){
+ stopSlide();
+ }else{
+ startSlide();
+ }
}
if(e->key() == Qt::Key_M){
markCurrent();
}
+
if((e->key() == Qt::Key_N) || (e->key() == Qt::Key_Down) || (e->key() == Qt::Key_Right)){
next();
}
@@ -658,7 +682,7 @@ void PictureViewer2::nextFromAll(){
}
void PictureViewer2::constructControlItem(){
- QStringList controls = QStringList() << "Next (>)" << "Previous (<)" << "Skip forward (>>)" << "Skip back (<<)" << "Stop Slide" << "Slide" << "Slide all";
+ QStringList controls = QStringList() << "Next (>)" << "Previous (<)" << "Skip forward (C->)" << "Skip back (C-<)" << "Stop Slide <SP>" << "Slide <SP>" << "Slide all <C-SP>";
QFont f = QFont();
f.setPointSize(14);
f.setBold(true);