S-Return (C-t, insert in curses) should return input, C-Return is mark. (C-r, C-space in curses)

This commit is contained in:
Jari Vetoniemi 2014-04-12 18:44:03 +03:00
parent ad4e0425a6
commit 3ad042c625
3 changed files with 10 additions and 1 deletions

View File

@ -88,6 +88,7 @@ typedef enum bmKey {
BM_KEY_ESCAPE,
BM_KEY_RETURN,
BM_KEY_SHIFT_RETURN,
BM_KEY_CONTROL_RETURN,
BM_KEY_UNICODE,
BM_KEY_LAST
} bmKey;

View File

@ -291,7 +291,13 @@ static bmKey _bmDrawCursesGetKey(unsigned int *unicode)
case 9: /* Tab */
return BM_KEY_TAB;
case 0: /* C-Space */
case 18: /* C-r */
return BM_KEY_CONTROL_RETURN;
case 20: /* C-t */
case 331: /* Insert */
_bmDrawCursesEndWin();
return BM_KEY_SHIFT_RETURN;
case 10: /* Return */

View File

@ -663,7 +663,7 @@ bmRunResult bmMenuRunWithKey(bmMenu *menu, bmKey key, unsigned int unicode)
}
break;
case BM_KEY_SHIFT_RETURN:
case BM_KEY_CONTROL_RETURN:
case BM_KEY_RETURN:
{
bmItem *highlighted = bmMenuGetHighlightedItem(menu);
@ -672,6 +672,7 @@ bmRunResult bmMenuRunWithKey(bmMenu *menu, bmKey key, unsigned int unicode)
}
break;
case BM_KEY_SHIFT_RETURN:
case BM_KEY_ESCAPE:
_bmItemListFreeList(&menu->selection);
break;
@ -682,6 +683,7 @@ bmRunResult bmMenuRunWithKey(bmMenu *menu, bmKey key, unsigned int unicode)
bmMenuFilter(menu);
switch (key) {
case BM_KEY_SHIFT_RETURN:
case BM_KEY_RETURN: return BM_RUN_RESULT_SELECTED;
case BM_KEY_ESCAPE: return BM_RUN_RESULT_CANCEL;
default: break;