mirror of
https://github.com/x64dbg/x64dbg.git
synced 2024-12-11 14:53:41 +00:00
GUI: Ctrl+Arrows allow selection of different script languages
This commit is contained in:
parent
a542c434bb
commit
f616d7d0f8
@ -3771,7 +3771,7 @@
|
||||
"mnem": "jnc"
|
||||
},
|
||||
{
|
||||
"description": "jump short if not equal (zf=0)",
|
||||
"description": "jump short if not equal/not zero (zf=0)",
|
||||
"mnem": "jne"
|
||||
},
|
||||
{
|
||||
|
@ -29,14 +29,9 @@ CommandLineEdit::CommandLineEdit(QWidget* parent)
|
||||
|
||||
void CommandLineEdit::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
// We only want key-press events for TAB
|
||||
if(event->type() != QEvent::KeyPress || event->key() != Qt::Key_Tab)
|
||||
if(event->type() == QEvent::KeyPress && event->key() == Qt::Key_Tab)
|
||||
{
|
||||
HistoryLineEdit::keyPressEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
// Tab autocompletes the command
|
||||
// TAB autocompletes the command
|
||||
QStringList stringList = mCompleterModel->stringList();
|
||||
|
||||
if(stringList.size())
|
||||
@ -68,6 +63,37 @@ void CommandLineEdit::keyPressEvent(QKeyEvent* event)
|
||||
popup->setCurrentIndex(currentModelIndex);
|
||||
popup->hide();
|
||||
}
|
||||
}
|
||||
else if(event->type() == QEvent::KeyPress && event->modifiers() == Qt::ControlModifier)
|
||||
{
|
||||
int index = mCmdScriptType->currentIndex(), count = mCmdScriptType->count();
|
||||
if(event->key() == Qt::Key_Up)
|
||||
{
|
||||
// Ctrl + Up selects the previous language
|
||||
if(index > 0)
|
||||
index--;
|
||||
else
|
||||
index = count - 1;
|
||||
}
|
||||
else if(event->key() == Qt::Key_Down)
|
||||
{
|
||||
// Ctrl + Down selects the next language
|
||||
index = (index + 1) % count;
|
||||
}
|
||||
else if(event->key() == Qt::Key_Left)
|
||||
{
|
||||
// Ctrl + Left selects the first language
|
||||
index = 0;
|
||||
}
|
||||
else if(event->key() == Qt::Key_Right)
|
||||
{
|
||||
// Ctrl + Right selects the last language
|
||||
index = count - 1;
|
||||
}
|
||||
mCmdScriptType->setCurrentIndex(index);
|
||||
}
|
||||
else
|
||||
HistoryLineEdit::keyPressEvent(event);
|
||||
}
|
||||
|
||||
// Disables moving to Prev/Next child when pressing tab
|
||||
|
Loading…
Reference in New Issue
Block a user