src/mess/filemngr.c
| r2554 | r2555 | |
| 426 | 426 | |
| 427 | 427 | |
| 428 | 428 | |
| 429 | | #define UI_SHIFT_PRESSED (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT)) |
| 430 | | #define UI_CONTROL_PRESSED (input_code_pressed(KEYCODE_LCONTROL) || input_code_pressed(KEYCODE_RCONTROL)) |
| 429 | #define UI_SHIFT_PRESSED (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT)) |
| 430 | |
| 431 | 431 | /* and mask to get bits */ |
| 432 | 432 | #define SEL_BITS_MASK (~SEL_MASK) |
| 433 | 433 | |
| r2554 | r2555 | |
| 516 | 516 | |
| 517 | 517 | visible = 0; |
| 518 | 518 | |
| 519 | | if (input_ui_pressed_repeat(IPT_UI_DOWN, 8)) |
| 519 | /* down advances by one item */ |
| 520 | if (input_ui_pressed_repeat(IPT_UI_DOWN, 6)) |
| 520 | 521 | { |
| 521 | | if (UI_CONTROL_PRESSED) |
| 522 | | { |
| 523 | | sel = total - 1; |
| 524 | | } |
| 525 | | else |
| 526 | | if (UI_SHIFT_PRESSED) |
| 527 | | { |
| 528 | | sel = (sel + visible - 1); |
| 529 | | sel = MIN(sel,total); |
| 530 | | } |
| 531 | | else |
| 532 | | { |
| 533 | | sel++; |
| 534 | | sel = MIN(sel,total); |
| 535 | | } |
| 522 | sel++; |
| 523 | sel = MIN(sel,total); |
| 536 | 524 | } |
| 537 | 525 | |
| 538 | | if (input_ui_pressed_repeat(IPT_UI_UP, 8)) |
| 526 | /* end goes to the last */ |
| 527 | if (input_ui_pressed_repeat(IPT_UI_END, 6)) |
| 539 | 528 | { |
| 540 | | if (UI_CONTROL_PRESSED) |
| 541 | | { |
| 542 | | sel = 1; |
| 543 | | } |
| 544 | | if (UI_SHIFT_PRESSED) |
| 545 | | { |
| 546 | | sel = (sel - visible + 1); |
| 547 | | sel = MAX(0,sel); |
| 548 | | } |
| 549 | | else |
| 550 | | { |
| 551 | | sel--; |
| 552 | | sel = MAX(0,sel); |
| 553 | | } |
| 529 | sel = total - 1; |
| 554 | 530 | } |
| 555 | 531 | |
| 532 | /* page down advances by visible_items */ |
| 533 | if (input_ui_pressed_repeat(IPT_UI_PAGE_DOWN, 6)) |
| 534 | { |
| 535 | sel = (sel + visible - 1); |
| 536 | sel = MIN(sel,total); |
| 537 | } |
| 538 | |
| 539 | /* up backs up by one item */ |
| 540 | if (input_ui_pressed_repeat(IPT_UI_DOWN, 6)) |
| 541 | { |
| 542 | sel--; |
| 543 | sel = MAX(0,sel); |
| 544 | } |
| 545 | |
| 546 | /* home goes to the start */ |
| 547 | if (input_ui_pressed_repeat(IPT_UI_HOME, 6)) |
| 548 | { |
| 549 | sel = 1; |
| 550 | } |
| 551 | |
| 552 | /* page up backs up by visible_items */ |
| 553 | if (input_ui_pressed_repeat(IPT_UI_PAGE_UP, 6)) |
| 554 | { |
| 555 | sel = (sel - visible + 1); |
| 556 | sel = MAX(0,sel); |
| 557 | } |
| 558 | |
| 556 | 559 | if (input_ui_pressed(IPT_UI_SELECT)) |
| 557 | 560 | { |
| 558 | 561 | if (sel < SEL_MASK) |