diff --git a/README.md b/README.md index d1cb48e0b..9c6c2c526 100644 --- a/README.md +++ b/README.md @@ -53,37 +53,38 @@ you'll need [homebrew](http://brew.sh/) to install the required dependencies. ## keyboard shortcuts -the current hotkeys are generally based around holding the alt/meta key with your left thumb, and using the home row with your right hand. +the hotkeys listed below can generally be used at any time; however, if an input field is focused some may not work. you can enter command mode by pressing `ESC`, which will highlight the bottom command bar and accept all hotkeys. command mode may be deactivated by pressing `ESC` again. + +you may also change hotkeys by editing `~/.mC2/hotkeys.json` and restarting the app. a hotkey tester is provided in the settings screen. - `TAB` select next window - `SHIFT+TAB` select previous window -- `ALT+~` switch to console view -- `ALT+a` switch to library view -- `ALT+s` switch to settings view -- `ALT+i` volume up 5% -- `ALT+k` volume down 5% -- `ALT+j` previous track -- `ALT+l` next track -- `ALT+u` back 10 seconds -- `ALT+o` forward 10 seconds -- `ALT+r` repaint the screen -- `ALT+,` toggle repeat mode (off/track/list) -- `ALT+.` (un)shuffle play queue +- `~` switch to console view +- `a` switch to library view +- `s` switch to settings view +- `i` volume up 5% +- `k` volume down 5% +- `j` previous track +- `l` next track +- `u` back 10 seconds +- `o` forward 10 seconds +- `r` repaint the screen +- `,` toggle repeat mode (off/track/list) +- `.` (un)shuffle play queue - `CTRL+p` pause/resume (globally) - `CTRL+x` stop (unload streams, free resources) - `CTRL+d` quit and a couple hotkeys that are specific to the library view: -- `ESC` toggle between browse and play queue -- `ALT+b` show browse view -- `ALT+n` show play queue -- `ALT+f` show album/artist/genre search -- `ALT+t` show track search -- `ALT+1` browse by artist -- `ALT+2` browse by album -- `ALT+3` browse by genre -- `ALT+m` jump to playing artist/album/genre in browse view +- `b` show browse view +- `n` show play queue +- `f` show album/artist/genre search +- `t` show track search +- `1` browse by artist +- `2` browse by album +- `3` browse by genre +- `m` jump to playing artist/album/genre in browse view - `SPACE` pause/resume *important*: on OSX make sure you configure your terminal emulator to treat your left alt key as "+Esc" or "Meta". diff --git a/src/musikbox/app/layout/ConsoleLayout.cpp b/src/musikbox/app/layout/ConsoleLayout.cpp index 46b2c98c1..3a7cec3ce 100755 --- a/src/musikbox/app/layout/ConsoleLayout.cpp +++ b/src/musikbox/app/layout/ConsoleLayout.cpp @@ -43,8 +43,10 @@ #include #include +#include #include +#include template bool tostr(T& t, const std::string& s) { @@ -151,6 +153,7 @@ void ConsoleLayout::SetVolume(float volume) { void ConsoleLayout::Help() { int64 s = -1; + this->output->WriteLine("help:\n", s); this->output->WriteLine(" to switch between windows", s); this->output->WriteLine("", s); @@ -168,6 +171,8 @@ void ConsoleLayout::Help() { this->output->WriteLine("", s); this->output->WriteLine(" plugins: list loaded plugins", s); this->output->WriteLine("", s); + this->output->WriteLine(" version: show musikbox app version", s); + this->output->WriteLine("", s); this->output->WriteLine(" : quit\n", s); } @@ -200,6 +205,10 @@ bool ConsoleLayout::ProcessCommand(const std::string& cmd) { else if (name == "clear") { this->logs->ClearContents(); } + else if (name == "version") { + const std::string v = boost::str(boost::format("build v%s") % VERSION); + this->output->WriteLine(v, -1); + } else if (name == "play" || name == "pl" || name == "p") { return this->PlayFile(args); } diff --git a/src/musikbox/app/layout/MainLayout.cpp b/src/musikbox/app/layout/MainLayout.cpp index f7ed37c24..23e7e305e 100755 --- a/src/musikbox/app/layout/MainLayout.cpp +++ b/src/musikbox/app/layout/MainLayout.cpp @@ -152,7 +152,7 @@ cursespp::IWindowPtr MainLayout::BlurShortcuts() { } bool MainLayout::KeyPress(const std::string& key) { - if (prefs->GetBool(box::prefs::keys::EscFocusesShortcuts)) { + if (prefs->GetBool(box::prefs::keys::EscFocusesShortcuts, true)) { if (key == "^[" || (key == "KEY_ENTER" && this->shortcutsFocused) || (key == "KEY_UP" && this->shortcutsFocused)) diff --git a/src/musikbox/app/layout/SettingsLayout.cpp b/src/musikbox/app/layout/SettingsLayout.cpp index c357ebfbb..9150027cd 100755 --- a/src/musikbox/app/layout/SettingsLayout.cpp +++ b/src/musikbox/app/layout/SettingsLayout.cpp @@ -248,7 +248,7 @@ void SettingsLayout::OnVisibilityChanged(bool visible) { void SettingsLayout::LoadPreferences() { this->removeCheckbox->SetChecked(this->prefs->GetBool(core::prefs::keys::RemoveMissingFiles, true)); - this->focusShortcutsCheckbox->SetChecked(this->prefs->GetBool(box::prefs::keys::EscFocusesShortcuts)); + this->focusShortcutsCheckbox->SetChecked(this->prefs->GetBool(box::prefs::keys::EscFocusesShortcuts, true)); this->customColorsCheckbox->SetChecked(this->prefs->GetBool(box::prefs::keys::DisableCustomColors)); } diff --git a/src/musikbox/app/util/Hotkeys.cpp b/src/musikbox/app/util/Hotkeys.cpp index 1c538ce39..688ed5bb1 100755 --- a/src/musikbox/app/util/Hotkeys.cpp +++ b/src/musikbox/app/util/Hotkeys.cpp @@ -84,27 +84,27 @@ static std::unordered_map NAME_TO_ID = { /* default hotkeys */ static std::unordered_map ID_TO_DEFAULT = { - { Id::NavigateLibrary, "M-a" }, - { Id::NavigateLibraryBrowse, "M-b" }, - { Id::NavigateLibraryBrowseArtists, "M-1" }, - { Id::NavigateLibraryBrowseAlbums, "M-2" }, - { Id::NavigateLibraryBrowseGenres, "M-3" }, - { Id::NavigateLibraryFilter, "M-f" }, - { Id::NavigateLibraryTracks, "M-t" }, - { Id::NavigateLibraryPlayQueue, "M-n" }, - { Id::NavigateSettings, "M-s" }, - { Id::NavigateConsole, "M-`" }, - { Id::NavigateJumpToPlaying, "M-m" }, + { Id::NavigateLibrary, "a" }, + { Id::NavigateLibraryBrowse, "b" }, + { Id::NavigateLibraryBrowseArtists, "1" }, + { Id::NavigateLibraryBrowseAlbums, "2" }, + { Id::NavigateLibraryBrowseGenres, "3" }, + { Id::NavigateLibraryFilter, "f" }, + { Id::NavigateLibraryTracks, "t" }, + { Id::NavigateLibraryPlayQueue, "n" }, + { Id::NavigateSettings, "s" }, + { Id::NavigateConsole, "`" }, + { Id::NavigateJumpToPlaying, "m" }, { Id::TogglePause, "^P" }, - { Id::Next, "M-l" }, - { Id::Previous, "M-j" }, - { Id::VolumeUp, "M-i" }, - { Id::VolumeDown, "M-k" }, - { Id::SeekForward, "M-o" }, - { Id::SeekBack, "M-u" }, - { Id::ToggleRepeat, "M-," }, - { Id::ToggleShuffle, "M-." }, + { Id::Next, "l" }, + { Id::Previous, "j" }, + { Id::VolumeUp, "i" }, + { Id::VolumeDown, "k" }, + { Id::SeekForward, "o" }, + { Id::SeekBack, "u" }, + { Id::ToggleRepeat, "," }, + { Id::ToggleShuffle, "." }, { Id::Stop, "^X" }, { Id::ViewRefresh, "KEY_F(5)" }, diff --git a/src/musikbox/app/util/Version.h b/src/musikbox/app/util/Version.h new file mode 100644 index 000000000..f03700dc0 --- /dev/null +++ b/src/musikbox/app/util/Version.h @@ -0,0 +1,3 @@ +#pragma once + +#define VERSION "0.1.0" /* todo: autogen */ \ No newline at end of file