left, right, and S shortcuts modified to use shift (#3116)

This commit is contained in:
David Szabo 2018-02-19 06:38:51 +01:00 committed by Zach H
parent 3d2c7b6670
commit 2409eae940
4 changed files with 15 additions and 10 deletions

View file

@ -21,11 +21,13 @@ bool KeySignals::eventFilter(QObject * /*object*/, QEvent *event)
break;
case Qt::Key_Right:
emit onRight();
if (kevent->modifiers() & Qt::ShiftModifier)
emit onShiftRight();
break;
case Qt::Key_Left:
emit onLeft();
if (kevent->modifiers() & Qt::ShiftModifier)
emit onShiftLeft();
break;
case Qt::Key_Delete:
@ -54,7 +56,8 @@ bool KeySignals::eventFilter(QObject * /*object*/, QEvent *event)
break;
case Qt::Key_S:
emit onS();
if (kevent->modifiers() & Qt::ShiftModifier)
emit onShiftS();
break;
default:

View file

@ -12,14 +12,14 @@ signals:
void onEnter();
void onCtrlEnter();
void onCtrlAltEnter();
void onLeft();
void onRight();
void onShiftLeft();
void onShiftRight();
void onDelete();
void onCtrlAltMinus();
void onCtrlAltEqual();
void onCtrlAltLBracket();
void onCtrlAltRBracket();
void onS();
void onShiftS();
protected:
virtual bool eventFilter(QObject *, QEvent *event);

View file

@ -147,7 +147,9 @@ bool ShortcutsSettings::isKeyAllowed(QString name, QString Sequences)
<< "Ctrl+Alt+]"
<< "Tab"
<< "Space"
<< "S");
<< "Shift+S"
<< "Shift+Left"
<< "Shift+Right");
if (forbiddenKeys.contains(checkSequence)) {
return false;
}

View file

@ -67,12 +67,12 @@ void TabDeckEditor::createDeckDock()
connect(deckView->selectionModel(), SIGNAL(currentRowChanged(const QModelIndex &, const QModelIndex &)), this,
SLOT(updateCardInfoRight(const QModelIndex &, const QModelIndex &)));
connect(deckView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(actSwapCard()));
connect(&deckViewKeySignals, SIGNAL(onS()), this, SLOT(actSwapCard()));
connect(&deckViewKeySignals, SIGNAL(onShiftS()), this, SLOT(actSwapCard()));
connect(&deckViewKeySignals, SIGNAL(onEnter()), this, SLOT(actIncrement()));
connect(&deckViewKeySignals, SIGNAL(onCtrlAltEqual()), this, SLOT(actIncrement()));
connect(&deckViewKeySignals, SIGNAL(onCtrlAltMinus()), this, SLOT(actDecrement()));
connect(&deckViewKeySignals, SIGNAL(onRight()), this, SLOT(actIncrement()));
connect(&deckViewKeySignals, SIGNAL(onLeft()), this, SLOT(actDecrement()));
connect(&deckViewKeySignals, SIGNAL(onShiftRight()), this, SLOT(actIncrement()));
connect(&deckViewKeySignals, SIGNAL(onShiftLeft()), this, SLOT(actDecrement()));
connect(&deckViewKeySignals, SIGNAL(onDelete()), this, SLOT(actRemoveCard()));
nameLabel = new QLabel();