From c6337cc8ba54de8b8ed80377b1c286db9dc2ee16 Mon Sep 17 00:00:00 2001 From: ansstuff Date: Sat, 26 May 2012 12:24:20 +0000 Subject: [PATCH] * Taseditor: Ctrl+Space accelerator = toggle "Auto-restore last position" checkbox * Taseditor: remapped "Restore Playback" hotkey to Spacebar * Taseditor: "Restore Playback" also pauses seeking * Taseditor: mid-click = "Restore Playback" when possible --- src/drivers/win/mapinput.cpp | 2 +- src/drivers/win/res.rc | 5 +++-- src/drivers/win/resource.h | 4 +++- src/drivers/win/taseditor/playback.cpp | 10 +++++++--- src/drivers/win/taseditor/taseditor_window.cpp | 1 + 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/drivers/win/mapinput.cpp b/src/drivers/win/mapinput.cpp index 8ce0f4b9..f1f241f7 100644 --- a/src/drivers/win/mapinput.cpp +++ b/src/drivers/win/mapinput.cpp @@ -75,7 +75,7 @@ static struct { EMUCMD_MISC_TOGGLEFULLSCREEN, SCAN_ENTER | CMD_KEY_ALT, }, { EMUCMD_TASEDITOR_REWIND, SCAN_BACKSPACE, }, { EMUCMD_RERECORD_DISPLAY_TOGGLE, SCAN_M, }, - { EMUCMD_TASEDITOR_RESTORE_PLAYBACK, SCAN_ENTER | CMD_KEY_CTRL, }, + { EMUCMD_TASEDITOR_RESTORE_PLAYBACK, SCAN_SPACE, }, { EMUCMD_TASEDITOR_CANCEL_SEEKING, SCAN_ESCAPE, }, }; diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index 70383648..b2431350 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -2195,6 +2195,8 @@ BEGIN "Q", ACCEL_CTRL_Q, VIRTKEY, CONTROL, NOINVERT VK_RIGHT, ACCEL_CTRL_RIGHT, VIRTKEY, CONTROL, NOINVERT "S", ACCEL_CTRL_S, VIRTKEY, CONTROL, NOINVERT + VK_INSERT, ACCEL_CTRL_SHIFT_INS, VIRTKEY, SHIFT, CONTROL, NOINVERT + "V", ACCEL_CTRL_SHIFT_V, VIRTKEY, SHIFT, CONTROL, NOINVERT VK_UP, ACCEL_CTRL_UP, VIRTKEY, CONTROL, NOINVERT "V", ACCEL_CTRL_V, VIRTKEY, CONTROL, NOINVERT "W", ACCEL_CTRL_W, VIRTKEY, CONTROL, NOINVERT @@ -2210,13 +2212,12 @@ BEGIN VK_DOWN, ACCEL_SHIFT_DOWN, VIRTKEY, SHIFT, NOINVERT VK_END, ACCEL_SHIFT_END, VIRTKEY, SHIFT, NOINVERT VK_HOME, ACCEL_SHIFT_HOME, VIRTKEY, SHIFT, NOINVERT - VK_INSERT, ACCEL_CTRL_SHIFT_INS, VIRTKEY, SHIFT, CONTROL, NOINVERT VK_LEFT, ACCEL_SHIFT_LEFT, VIRTKEY, SHIFT, NOINVERT VK_NEXT, ACCEL_SHIFT_PGDN, VIRTKEY, SHIFT, NOINVERT VK_PRIOR, ACCEL_SHIFT_PGUP, VIRTKEY, SHIFT, NOINVERT VK_RIGHT, ACCEL_SHIFT_RIGHT, VIRTKEY, SHIFT, NOINVERT VK_UP, ACCEL_SHIFT_UP, VIRTKEY, SHIFT, NOINVERT - "V", ACCEL_CTRL_SHIFT_V, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_SPACE, ACCEL_CTRL_SPACE, VIRTKEY, CONTROL, NOINVERT END IDR_RWACCELERATOR ACCELERATORS diff --git a/src/drivers/win/resource.h b/src/drivers/win/resource.h index 43289e21..4ace07cc 100644 --- a/src/drivers/win/resource.h +++ b/src/drivers/win/resource.h @@ -1011,6 +1011,8 @@ #define ID_CONFIG_AUTOPAUSEATTHEENDOFMOVIE 40559 #define ID_SELECTED_SETMARKERS 40560 #define ID_SELECTED_REMOVEMARKERS 40561 +#define ACCEL_CTRL_SPACEBAR 40563 +#define ACCEL_CTRL_SPACE 40563 #define IDC_DEBUGGER_ICONTRAY 55535 #define MW_ValueLabel2 65423 #define MW_ValueLabel1 65426 @@ -1020,7 +1022,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 206 -#define _APS_NEXT_COMMAND_VALUE 40563 +#define _APS_NEXT_COMMAND_VALUE 40564 #define _APS_NEXT_CONTROL_VALUE 1281 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/src/drivers/win/taseditor/playback.cpp b/src/drivers/win/taseditor/playback.cpp index ae5caa84..67c50ab7 100644 --- a/src/drivers/win/taseditor/playback.cpp +++ b/src/drivers/win/taseditor/playback.cpp @@ -274,7 +274,12 @@ void PLAYBACK::UnpauseEmulation() void PLAYBACK::RestorePosition() { if (lost_position_frame && lost_position_frame > currFrameCounter + 1) - SeekingStart(lost_position_frame); + { + if (emu_paused) + SeekingStart(lost_position_frame); + else + PauseEmulation(); + } } void PLAYBACK::MiddleButtonClick() { @@ -299,9 +304,8 @@ void PLAYBACK::MiddleButtonClick() int selection_beginning = selection.GetCurrentSelectionBeginning(); if (selection_beginning > currFrameCounter) SeekingStart(selection_beginning + 1); - } else if (GetAsyncKeyState(VK_MENU) < 0) + } else if (lost_position_frame && lost_position_frame > currFrameCounter + 1) // (GetAsyncKeyState(VK_MENU) < 0) { - // if Alt is held, Restore Playback RestorePosition(); } else { diff --git a/src/drivers/win/taseditor/taseditor_window.cpp b/src/drivers/win/taseditor/taseditor_window.cpp index 6c3188e0..9089015c 100644 --- a/src/drivers/win/taseditor/taseditor_window.cpp +++ b/src/drivers/win/taseditor/taseditor_window.cpp @@ -1048,6 +1048,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara taseditor_window.UpdateCheckedItems(); break; case CHECK_AUTORESTORE_PLAYBACK: + case ACCEL_CTRL_SPACE: taseditor_config.restore_position ^= 1; taseditor_window.UpdateCheckedItems(); break;