mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
add vim bindings to split input movement
This commit is contained in:
parent
3f41dfeff9
commit
777ac017df
|
@ -246,6 +246,54 @@ void SplitInput::installKeyPressedEvent()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (event->key() == Qt::Key_H &&
|
||||
event->modifiers() == Qt::AltModifier)
|
||||
{
|
||||
// h: vim binding for left
|
||||
SplitContainer *page = this->split_->getContainer();
|
||||
event->accept();
|
||||
|
||||
if (page != nullptr)
|
||||
{
|
||||
page->selectNextSplit(SplitContainer::Left);
|
||||
}
|
||||
}
|
||||
else if (event->key() == Qt::Key_J &&
|
||||
event->modifiers() == Qt::AltModifier)
|
||||
{
|
||||
// j: vim binding for down
|
||||
SplitContainer *page = this->split_->getContainer();
|
||||
event->accept();
|
||||
|
||||
if (page != nullptr)
|
||||
{
|
||||
page->selectNextSplit(SplitContainer::Below);
|
||||
}
|
||||
}
|
||||
else if (event->key() == Qt::Key_K &&
|
||||
event->modifiers() == Qt::AltModifier)
|
||||
{
|
||||
// k: vim binding for up
|
||||
SplitContainer *page = this->split_->getContainer();
|
||||
event->accept();
|
||||
|
||||
if (page != nullptr)
|
||||
{
|
||||
page->selectNextSplit(SplitContainer::Above);
|
||||
}
|
||||
}
|
||||
else if (event->key() == Qt::Key_L &&
|
||||
event->modifiers() == Qt::AltModifier)
|
||||
{
|
||||
// l: vim binding for right
|
||||
SplitContainer *page = this->split_->getContainer();
|
||||
event->accept();
|
||||
|
||||
if (page != nullptr)
|
||||
{
|
||||
page->selectNextSplit(SplitContainer::Right);
|
||||
}
|
||||
}
|
||||
else if (event->key() == Qt::Key_Down)
|
||||
{
|
||||
if ((event->modifiers() & Qt::ShiftModifier) != 0)
|
||||
|
|
Loading…
Reference in a new issue