mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 06:53:01 +00:00
GUI: home/end keys
This commit is contained in:
parent
5dfe19e52d
commit
80c03fcbae
2 changed files with 36 additions and 0 deletions
|
@ -1835,6 +1835,34 @@ void FurnaceGUI::moveCursor(int x, int y) {
|
|||
updateScroll(cursor.y);
|
||||
}
|
||||
|
||||
void FurnaceGUI::moveCursorTop() {
|
||||
finishSelection();
|
||||
curNibble=false;
|
||||
if (cursor.y==0) {
|
||||
cursor.xCoarse=0;
|
||||
cursor.xFine=0;
|
||||
} else {
|
||||
cursor.y=0;
|
||||
}
|
||||
selStart=cursor;
|
||||
selEnd=cursor;
|
||||
updateScroll(cursor.y);
|
||||
}
|
||||
|
||||
void FurnaceGUI::moveCursorBottom() {
|
||||
finishSelection();
|
||||
curNibble=false;
|
||||
if (cursor.y==e->song.patLen-1) {
|
||||
cursor.xCoarse=e->getTotalChannelCount()-1;
|
||||
cursor.xFine=2+e->song.pat[cursor.xCoarse].effectRows*2;
|
||||
} else {
|
||||
cursor.y=e->song.patLen-1;
|
||||
}
|
||||
selStart=cursor;
|
||||
selEnd=cursor;
|
||||
updateScroll(cursor.y);
|
||||
}
|
||||
|
||||
void FurnaceGUI::editAdvance() {
|
||||
finishSelection();
|
||||
cursor.y+=editStep;
|
||||
|
@ -2353,6 +2381,12 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
|
|||
case SDLK_PAGEDOWN:
|
||||
moveCursor(0,16);
|
||||
break;
|
||||
case SDLK_HOME:
|
||||
moveCursorTop();
|
||||
break;
|
||||
case SDLK_END:
|
||||
moveCursorBottom();
|
||||
break;
|
||||
case SDLK_DELETE:
|
||||
doDelete();
|
||||
break;
|
||||
|
|
|
@ -235,6 +235,8 @@ class FurnaceGUI {
|
|||
void finishSelection();
|
||||
|
||||
void moveCursor(int x, int y);
|
||||
void moveCursorTop();
|
||||
void moveCursorBottom();
|
||||
void editAdvance();
|
||||
void prepareUndo(ActionType action);
|
||||
void makeUndo(ActionType action);
|
||||
|
|
Loading…
Reference in a new issue