Skip to content

Commit

Permalink
Fixes herace#4 and fixes saved tabs issue
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon committed Nov 13, 2019
1 parent 5fe451a commit 144c58b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ctrl/KeyBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ void KeyBinding::setSerialValue(const QString& aValue)
mKeyCode = key;
mSubKeyCode = subKey;
mModifiers = Qt::NoModifier;
// Values (0x01, 0x02, etc.) are short versions of the Qt modifier enums (Qt::<XXXModifier>)
if (mod & 0x01) mModifiers |= Qt::ControlModifier;
if (mod & 0x02) mModifiers |= Qt::ShiftModifier;
if (mod & 0x04) mModifiers |= Qt::AltModifier;
if (mod & 0x06) mModifiers |= Qt::KeypadModifier;
if (mod & 0x08) mModifiers |= Qt::MetaModifier;
if (mod & 0x20) mModifiers |= Qt::KeypadModifier;

if (!isValidBinding())
{
Expand All @@ -172,8 +173,8 @@ QString KeyBinding::serialValue() const
mod |= mModifiers.testFlag(Qt::ControlModifier) ? 0x01 : 0x00;
mod |= mModifiers.testFlag(Qt::ShiftModifier) ? 0x02 : 0x00;
mod |= mModifiers.testFlag(Qt::AltModifier) ? 0x04 : 0x00;
mod |= mModifiers.testFlag(Qt::KeypadModifier) ? 0x06 : 0x00;
mod |= mModifiers.testFlag(Qt::MetaModifier) ? 0x08 : 0x00;
mod |= mModifiers.testFlag(Qt::KeypadModifier) ? 0x20 : 0x00;
return QString::number(mKeyCode) + "," + QString::number(mod) + "," + QString::number(mSubKeyCode);
}

Expand Down

0 comments on commit 144c58b

Please sign in to comment.