Skip to content

Commit eb4f61c

Browse files
committed
Toggle keyboard help with 'h'
1 parent 4ec5e7f commit eb4f61c

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

doc/en/sidplayfp.pod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ Toggle filter.
251251

252252
Pause/unpause playback.
253253

254+
=item h
255+
256+
Show/hide help.
257+
254258
=item Esc
255259

256260
Quit player.

src/keyboard.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static char keytable[] =
9999

100100
// General Keys
101101
'p',0, A_PAUSED,
102+
'h',0, A_HELP,
102103
ESC,ESC,0, A_QUIT,
103104

104105
// Old Keys

src/keyboard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ enum
4545
A_HOME,
4646
A_END,
4747
A_PAUSED,
48+
A_HELP,
4849
A_QUIT,
4950

5051
/* Debug */

src/menu.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,18 +506,18 @@ void ConsolePlayer::menu ()
506506
}
507507
cerr << endl;
508508

509-
if (m_verboseLevel)
509+
if (m_showhelp)
510510
{
511511
consoleTable(table_t::separator);
512512
consoleTable(table_t::middle);
513513
consoleColour((m_iniCfg.console()).title);
514514
cerr << " ←/→ Previous/Next 1-9 Toggle voices p Pause" << endl;
515515
consoleTable(table_t::middle);
516516
consoleColour((m_iniCfg.console()).title);
517-
cerr << " ↓/↑ Standard/Fast qwe Toggle sample Esc Quit" << endl;
517+
cerr << " ↓/↑ Standard/Fast qwe Toggle sample h Help" << endl;
518518
consoleTable(table_t::middle);
519519
consoleColour((m_iniCfg.console()).title);
520-
cerr << " ⇱/⇲ First/Last f Toggle filter" << endl;
520+
cerr << " ⇱/⇲ First/Last f Toggle filter Esc Quit" << endl;
521521
}
522522

523523
#ifdef FEAT_REGS_DUMP_SID

src/player.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ ConsolePlayer::ConsolePlayer (const char * const name) :
344344
m_outfile(nullptr),
345345
m_filename(""),
346346
m_quietLevel(0),
347+
m_showhelp(false),
347348
songlengthDB(sldb_t::NONE),
348349
m_cpudebug(false),
349350
m_autofilter(false)
@@ -1393,6 +1394,11 @@ void ConsolePlayer::decodeKeys ()
13931394
}
13941395
break;
13951396

1397+
case A_HELP:
1398+
m_showhelp = !m_showhelp;
1399+
menu();
1400+
break;
1401+
13961402
case A_TOGGLE_VOICE1:
13971403
m_mute_channel.flip(0);
13981404
m_engine.mute(0, 0, m_mute_channel[0]);

src/player.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class ConsolePlayer
172172
// Display parameters
173173
uint_least8_t m_quietLevel;
174174
uint_least8_t m_verboseLevel;
175+
bool m_showhelp;
175176

176177
sldb_t songlengthDB;
177178

0 commit comments

Comments
 (0)