mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-10 17:49:32 +08:00
Cursor A graph scrolling implementation
If Cursor A goes off the screen, it will reposition the window to place the cursor in the middle of it.
This commit is contained in:
parent
6a7e70ad26
commit
3d2169b833
1 changed files with 24 additions and 2 deletions
|
@ -1260,33 +1260,55 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
|||
RepaintGraphWindow();
|
||||
break;
|
||||
|
||||
case Qt::Key_BracketLeft:
|
||||
case Qt::Key_BracketLeft: {
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
CursorAPos -= 5;
|
||||
} else {
|
||||
CursorAPos -= 1;
|
||||
}
|
||||
|
||||
if((CursorAPos >= g_GraphStop) || (CursorAPos <= g_GraphStart)) {
|
||||
uint32_t halfway = PageWidth / 2;
|
||||
|
||||
if((CursorAPos - halfway) > g_GraphTraceLen) {
|
||||
g_GraphStart = 0;
|
||||
} else {
|
||||
g_GraphStart = CursorAPos - halfway;
|
||||
}
|
||||
}
|
||||
|
||||
if(CursorAPos < g_GraphStart) {
|
||||
CursorAPos = g_GraphStart;
|
||||
}
|
||||
|
||||
RepaintGraphWindow();
|
||||
break;
|
||||
}
|
||||
|
||||
case Qt::Key_BracketRight:
|
||||
case Qt::Key_BracketRight: {
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
CursorAPos += 5;
|
||||
} else {
|
||||
CursorAPos += 1;
|
||||
}
|
||||
|
||||
if((CursorAPos >= g_GraphStop) || (CursorAPos <= g_GraphStart)) {
|
||||
uint32_t halfway = PageWidth / 2;
|
||||
|
||||
if((CursorAPos + halfway) >= g_GraphTraceLen) {
|
||||
g_GraphStart = g_GraphTraceLen - halfway;
|
||||
} else {
|
||||
g_GraphStart = CursorAPos - halfway;
|
||||
}
|
||||
}
|
||||
|
||||
if(CursorAPos >= g_GraphTraceLen) {
|
||||
CursorAPos = g_GraphTraceLen;
|
||||
}
|
||||
|
||||
RepaintGraphWindow();
|
||||
break;
|
||||
}
|
||||
|
||||
case Qt::Key_BraceLeft:
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
|
|
Loading…
Reference in a new issue