let [tokens, token_starts] = parser.tokenize(tui.inputEl.value);
if (tokens.length > 0 && tokens[0].length > 0) {
if (tui.inputEl.value[0][0] == '/') {
- if (tokens[0].slice(1) == 'play' || tokens[0].slice(1) == 'P') {
+ if (tokens[0].slice(1) == 'play' || tokens[0][1] == tui.keys.switch_to_play) {
tui.switch_mode(mode_play);
- } else if (tokens[0].slice(1) == 'study' || tokens[0].slice(1) == '?') {
+ } else if (tokens[0].slice(1) == 'study' || tokens[0][1] == tui.keys.switch_to_study) {
tui.switch_mode(mode_study);
} else if (tokens[0].slice(1) == 'help') {
tui.log_help();