Add some keyboard shortcuts for demos

This commit is contained in:
def 2020-09-08 11:42:52 +02:00
parent 757998e7d0
commit 7bea697114

View file

@ -458,7 +458,7 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
// close button // close button
ButtonBar.VSplitRight(ButtonbarHeight*3, &ButtonBar, &Button); ButtonBar.VSplitRight(ButtonbarHeight*3, &ButtonBar, &Button);
static int s_ExitButton = 0; static int s_ExitButton = 0;
if(DoButton_DemoPlayer(&s_ExitButton, Localize("Close"), 0, &Button)) if(DoButton_DemoPlayer(&s_ExitButton, Localize("Close"), 0, &Button) || Input()->KeyPress(KEY_C))
{ {
Client()->Disconnect(); Client()->Disconnect();
DemolistOnUpdate(false); DemolistOnUpdate(false);
@ -1245,7 +1245,7 @@ void CMenus::RenderDemoList(CUIRect MainView)
} }
static int s_PlayButton = 0; static int s_PlayButton = 0;
if(DoButton_Menu(&s_PlayButton, m_DemolistSelectedIsDir?Localize("Open"):Localize("Play"), 0, &PlayRect) || Activated) if(DoButton_Menu(&s_PlayButton, m_DemolistSelectedIsDir?Localize("Open"):Localize("Play"), 0, &PlayRect) || Activated || Input()->KeyPress(KEY_P))
{ {
if(m_DemolistSelectedIndex >= 0) if(m_DemolistSelectedIndex >= 0)
{ {
@ -1282,7 +1282,7 @@ void CMenus::RenderDemoList(CUIRect MainView)
if(!m_DemolistSelectedIsDir) if(!m_DemolistSelectedIsDir)
{ {
static int s_DeleteButton = 0; static int s_DeleteButton = 0;
if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &DeleteRect) || m_DeletePressed) if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &DeleteRect) || m_DeletePressed || Input()->KeyPress(KEY_D))
{ {
if(m_DemolistSelectedIndex >= 0) if(m_DemolistSelectedIndex >= 0)
{ {
@ -1306,7 +1306,7 @@ void CMenus::RenderDemoList(CUIRect MainView)
#if defined(CONF_VIDEORECORDER) #if defined(CONF_VIDEORECORDER)
static int s_RenderButton = 0; static int s_RenderButton = 0;
if(DoButton_Menu(&s_RenderButton, Localize("Render"), 0, &RenderRect)) if(DoButton_Menu(&s_RenderButton, Localize("Render"), 0, &RenderRect) || Input()->KeyPress(KEY_R))
{ {
if(m_DemolistSelectedIndex >= 0) if(m_DemolistSelectedIndex >= 0)
{ {