Couple small tweaks to make things a bit smoother going in Linux

This commit is contained in:
clangen 2016-06-06 20:59:56 -07:00
parent 26d34a596c
commit 301985a335
2 changed files with 4 additions and 5 deletions

View File

@ -176,8 +176,7 @@ static inline std::string readKeyPress(int64 ch) {
kn += (char)getch();
}
//std::cerr << "keyname: " << kn << std::endl;
// std::cerr << "keyname: " << kn << std::endl;
// std::cerr << "ch: " << ch << std::endl;
return kn;
@ -293,10 +292,10 @@ int main(int argc, char* argv[])
else if (kn == "KEY_RESIZE") {
resizeAt = now() + REDRAW_DEBOUNCE_MS;
}
else if (ch == KEY_F(1)) {
else if (ch == KEY_F(1) || kn == "M-q") {
changeLayout(state, consoleLayout);
}
else if (ch == KEY_F(2)) {
else if (ch == KEY_F(2) || kn == "M-w") {
changeLayout(state, libraryLayout);
}
else if (!globalHotkeys.Handle(kn)) {

View File

@ -81,7 +81,7 @@ void removeUtf8Char(std::string& value) {
}
void CommandWindow::Write(const std::string& key) {
if (key == "^H" || key == "^?") { /* backspace */
if (key == "^H" || key == "^?" || key == "KEY_BACKSPACE") { /* backspace */
removeUtf8Char(this->buffer);
}
else if (key == "^M") { /* return */