1 #include "bindings.h" 2 #include "mixer_widget.h" 3 4 #define CNTRL(C) (C%32) 5 6 uint8_t textbox_bindings[KEY_MAX] = { 7 ['\n'] = CMD_TEXTBOX_CLOSE, 8 ['\r'] = CMD_TEXTBOX_CLOSE, 9 [27] = CMD_TEXTBOX_CLOSE, 10 [KEY_CANCEL] = CMD_TEXTBOX_CLOSE, 11 [KEY_ENTER] = CMD_TEXTBOX_CLOSE, 12 [KEY_CLOSE] = CMD_TEXTBOX_CLOSE, 13 [KEY_EXIT] = CMD_TEXTBOX_CLOSE, 14 [KEY_DOWN] = CMD_TEXTBOX_DOWN, 15 [KEY_SF] = CMD_TEXTBOX_DOWN, 16 ['J'] = CMD_TEXTBOX_DOWN, 17 ['j'] = CMD_TEXTBOX_DOWN, 18 ['X'] = CMD_TEXTBOX_DOWN, 19 ['x'] = CMD_TEXTBOX_DOWN, 20 [KEY_UP] = CMD_TEXTBOX_UP, 21 [KEY_SR] = CMD_TEXTBOX_UP, 22 ['K'] = CMD_TEXTBOX_UP, 23 ['k'] = CMD_TEXTBOX_UP, 24 ['W'] = CMD_TEXTBOX_UP, 25 ['w'] = CMD_TEXTBOX_UP, 26 [KEY_LEFT] = CMD_TEXTBOX_LEFT, 27 ['H'] = CMD_TEXTBOX_LEFT, 28 ['h'] = CMD_TEXTBOX_LEFT, 29 ['P'] = CMD_TEXTBOX_LEFT, 30 ['p'] = CMD_TEXTBOX_LEFT, 31 [KEY_RIGHT] = CMD_TEXTBOX_RIGHT, 32 ['L'] = CMD_TEXTBOX_RIGHT, 33 ['l'] = CMD_TEXTBOX_RIGHT, 34 ['N'] = CMD_TEXTBOX_RIGHT, 35 ['n'] = CMD_TEXTBOX_RIGHT, 36 [KEY_NPAGE] = CMD_TEXTBOX_PAGE_DOWN, 37 [' '] = CMD_TEXTBOX_PAGE_DOWN, 38 [KEY_PPAGE] = CMD_TEXTBOX_PAGE_UP, 39 [KEY_BACKSPACE] = CMD_TEXTBOX_PAGE_UP, 40 ['B'] = CMD_TEXTBOX_PAGE_UP, 41 ['b'] = CMD_TEXTBOX_PAGE_UP, 42 [KEY_HOME] = CMD_TEXTBOX_TOP, 43 [KEY_BEG] = CMD_TEXTBOX_TOP, 44 [KEY_LL] = CMD_TEXTBOX_BOTTOM, 45 [KEY_END] = CMD_TEXTBOX_BOTTOM, 46 ['\t'] = CMD_TEXTBOX_PAGE_RIGHT, 47 [KEY_BTAB] = CMD_TEXTBOX_PAGE_LEFT, 48 }; 49 50 command_enum mixer_bindings[] = { 51 [27] = CMD_MIXER_CLOSE, 52 [KEY_CANCEL] = CMD_MIXER_CLOSE, 53 [KEY_F(10)] = CMD_MIXER_CLOSE, 54 [KEY_F(1)] = CMD_MIXER_HELP, 55 [KEY_HELP] = CMD_MIXER_HELP, 56 ['H'] = CMD_MIXER_HELP, 57 ['h'] = CMD_MIXER_HELP, 58 ['?'] = CMD_MIXER_HELP, 59 [KEY_F(2)] = CMD_MIXER_SYSTEM_INFORMATION, 60 ['/'] = CMD_MIXER_SYSTEM_INFORMATION, 61 [KEY_F(3)] = CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, VIEW_MODE_PLAYBACK), 62 [KEY_F(4)] = CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, VIEW_MODE_CAPTURE), 63 [KEY_F(5)] = CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, VIEW_MODE_ALL), 64 ['\t'] = CMD_MIXER_TOGGLE_VIEW_MODE, 65 [KEY_F(6)] = CMD_MIXER_SELECT_CARD, 66 ['S'] = CMD_MIXER_SELECT_CARD, 67 ['s'] = CMD_MIXER_SELECT_CARD, 68 [KEY_REFRESH] = CMD_MIXER_REFRESH, 69 [CNTRL('L')] = CMD_MIXER_REFRESH, 70 ['L'] = CMD_MIXER_REFRESH, 71 ['l'] = CMD_MIXER_REFRESH, 72 [KEY_LEFT] = CMD_WITH_ARG(CMD_MIXER_PREVIOUS, 1), 73 ['p'] = CMD_WITH_ARG(CMD_MIXER_PREVIOUS, 1), 74 ['P'] = CMD_WITH_ARG(CMD_MIXER_PREVIOUS, 1), 75 [KEY_RIGHT] = CMD_WITH_ARG(CMD_MIXER_NEXT, 1), 76 ['N'] = CMD_WITH_ARG(CMD_MIXER_NEXT, 1), 77 ['n'] = CMD_WITH_ARG(CMD_MIXER_NEXT, 1), 78 [KEY_PPAGE] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 5), 79 [KEY_NPAGE] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 5), 80 [KEY_LL] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 0), 81 [KEY_END] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 0), 82 ['0'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 0), 83 ['1'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 10), 84 ['2'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 20), 85 ['3'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 30), 86 ['4'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 40), 87 ['5'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 50), 88 ['6'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 60), 89 ['7'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 70), 90 ['8'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 80), 91 ['9'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 90), 92 #if 0 93 [KEY_BEG] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 100), 94 [KEY_HELP] = CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 100), 95 #endif 96 [KEY_UP] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1), 97 ['+'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1), 98 ['K'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1), 99 ['k'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1), 100 ['W'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1), 101 ['w'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1), 102 [KEY_DOWN] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1), 103 ['-'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1), 104 ['J'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1), 105 ['j'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1), 106 ['X'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1), 107 ['x'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1), 108 ['Q'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP_LEFT, 1), 109 ['q'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP_LEFT, 1), 110 ['Y'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_LEFT, 1), 111 ['y'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_LEFT, 1), 112 ['Z'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_LEFT, 1), 113 ['z'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_LEFT, 1), 114 ['E'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP_RIGHT, 1), 115 ['e'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_UP_RIGHT, 1), 116 ['C'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_RIGHT, 1), 117 ['c'] = CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_RIGHT, 1), 118 ['M'] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, LEFT|RIGHT), 119 ['m'] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, LEFT|RIGHT), 120 ['<'] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, LEFT), 121 [','] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, LEFT), 122 ['>'] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, RIGHT), 123 ['.'] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, RIGHT), 124 [' '] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, LEFT|RIGHT), 125 [KEY_IC] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, LEFT), 126 [';'] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, LEFT), 127 [KEY_DC] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, RIGHT), 128 ['\''] = CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, RIGHT), 129 ['B'] = CMD_MIXER_BALANCE_CONTROL, 130 ['b'] = CMD_MIXER_BALANCE_CONTROL, 131 ['='] = CMD_MIXER_BALANCE_CONTROL, 132 }; 133