* fixed "X" button in the "Enter New Input" dialog (Hotkey Mapping); changed "Cancel" button to "OK"

* Taseditor: fixed accelerators when editing Notes
This commit is contained in:
ansstuff 2012-12-03 17:11:17 +00:00
parent 5ca09c31d5
commit e21ed84dfa
8 changed files with 49 additions and 109 deletions

View File

@ -1,3 +1,7 @@
03-Dec-2012 - AnS - Taseditor: fixed accelerators when editing Notes
03-Dec-2012 - AnS - fixed "X" button in the "Enter New Input" dialog (Hotkey Mapping); changed "Cancel" button to "OK"
03-Dec-2012 - CaH4e3 - fixed mapper 99
30-Nov-2012 - CaH4e3 - more mappers to boards conversion
29-Nov-2012 - zeromus - fix "you ling xing dong" by assigning to mapper 192
---r2768 - FCEUX 2.2.0 Released---

View File

@ -74,6 +74,7 @@
#include "taseditor/taseditor_window.h"
extern TASEDITOR_WINDOW taseditor_window;
extern bool taseditor_accelerator_keys;
//---------------------------
//mbg merge 6/29/06 - new aboutbox
@ -344,7 +345,7 @@ int BlockingCheck()
}
}
if(!handled && taseditor_window.hwndTasEditor)
if(!handled && taseditor_window.hwndTasEditor && taseditor_accelerator_keys)
{
if(IsChild(taseditor_window.hwndTasEditor, msg.hwnd))
handled = TranslateAccelerator(taseditor_window.hwndTasEditor, fceu_hAccel, &msg);

View File

@ -344,15 +344,14 @@ BOOL CALLBACK ChangeInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
case WM_COMMAND:
switch(LOWORD(wParam)) // CaH4e3: BN_CLICKED redundant define removed since it always 0, Esc mapping used to be handled as well (I need it too :))
{
case BTN_CANCEL:
key = 0;
case BTN_OK:
// Send quit message.
PostMessage(hwndDlg, WM_USER + 1, 0, 0);
PostMessage(hwndDlg, WM_USER + 99, 0, 0);
break;
case BTN_CLEAR:
key = -1;
// Send quit message.
PostMessage(hwndDlg, WM_USER + 1, 0, 0);
PostMessage(hwndDlg, WM_USER + 99, 0, 0);
break;
default:
break;
@ -375,26 +374,27 @@ BOOL CALLBACK ChangeInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
}
else if(NothingPressed() && key)
{
PostMessage(hwndDlg, WM_USER+1, 0, 0); // Send quit message.
PostMessage(hwndDlg, WM_USER + 99, 0, 0); // Send quit message.
}
}
break;
case WM_USER+1:
{
// Done with keyboard.
KeyboardSetBackgroundAccess(false);
case WM_CLOSE:
// exit without changing the key mapping
key = 0;
case WM_USER + 99:
// Done with keyboard.
KeyboardSetBackgroundAccess(false);
// Kill the thread.
SetEvent(threadargs.hThreadExit);
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
CloseHandle(threadargs.hThreadExit);
// Kill the thread.
SetEvent(threadargs.hThreadExit);
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
CloseHandle(threadargs.hThreadExit);
// End the dialog.
EndDialog(hwndDlg, key);
return TRUE;
}
// End the dialog.
EndDialog(hwndDlg, key);
return TRUE;
default:
break;

View File

@ -840,9 +840,9 @@ STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Enter New Input"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
PUSHBUTTON "Cancel",BTN_CANCEL,40,45,50,14
CTEXT "Press a key",LBL_KEY_COMBO,31,14,122,20
PUSHBUTTON "Clear",BTN_CLEAR,95,45,50,14
PUSHBUTTON "OK",BTN_OK,40,45,50,14
END
PALCONFIG DIALOGEX 16, 81, 228, 116

View File

@ -240,6 +240,8 @@
#define IDC_NTVIEW_REFRESH_TRACKBAR 201
#define IDC_ASSEMBLER_APPLY 201
#define IDI_ICON4 201
#define BTN_CLEAR2 201
#define BTN_OK 201
#define MENU_EJECT_DISK 202
#define TXT_FAM 202
#define MENU_MV_EDIT_PASTE 202

View File

@ -32,6 +32,7 @@ using namespace std;
bool emulator_must_run_taseditor = false;
bool Taseditor_rewind_now = false;
bool must_call_manual_lua_function = false;
bool taseditor_accelerator_keys = false;
// all Taseditor functional modules
TASEDITOR_CONFIG taseditor_config;
@ -913,15 +914,17 @@ void Taseditor_EMUCMD(int command)
}
}
// these functions allow/disallow some FCEUX hotkeys
// these functions allow/disallow some FCEUX hotkeys and TAS Editor accelerators
void SetTaseditorInput()
{
taseditor_accelerator_keys = true;
// set "Background TAS Editor input"
KeyboardSetBackgroundAccessBit(KEYBACKACCESS_TASEDITOR);
JoystickSetBackgroundAccessBit(JOYBACKACCESS_TASEDITOR);
}
void ClearTaseditorInput()
{
taseditor_accelerator_keys = false;
// clear "Background TAS Editor input"
KeyboardClearBackgroundAccessBit(KEYBACKACCESS_TASEDITOR);
JoystickClearBackgroundAccessBit(JOYBACKACCESS_TASEDITOR);

View File

@ -917,11 +917,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
selection.ClearSelection();
break;
case ID_EDIT_SELECTALL:
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETSEL, 0, -1);
else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETSEL, 0, -1);
else if (piano_roll.drag_mode != DRAG_MODE_SELECTION && piano_roll.drag_mode != DRAG_MODE_DESELECTION)
if (piano_roll.drag_mode != DRAG_MODE_SELECTION && piano_roll.drag_mode != DRAG_MODE_DESELECTION)
selection.SelectAll();
break;
case ID_SELECTED_UNGREENZONE:
@ -929,39 +925,19 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break;
case ACCEL_CTRL_X:
case ID_EDIT_CUT:
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
SendMessage(playback.hwndPlaybackMarkerEdit, WM_CUT, 0, 0);
else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
SendMessage(selection.hwndSelectionMarkerEdit, WM_CUT, 0, 0);
else
splicer.Cut();
splicer.Cut();
break;
case ACCEL_CTRL_C:
case ID_EDIT_COPY:
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
SendMessage(playback.hwndPlaybackMarkerEdit, WM_COPY, 0, 0);
else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
SendMessage(selection.hwndSelectionMarkerEdit, WM_COPY, 0, 0);
else
splicer.Copy();
splicer.Copy();
break;
case ACCEL_CTRL_V:
case ID_EDIT_PASTE:
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
SendMessage(playback.hwndPlaybackMarkerEdit, WM_PASTE, 0, 0);
else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
SendMessage(selection.hwndSelectionMarkerEdit, WM_PASTE, 0, 0);
else
splicer.Paste();
splicer.Paste();
break;
case ACCEL_CTRL_SHIFT_V:
case ID_EDIT_PASTEINSERT:
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
SendMessage(playback.hwndPlaybackMarkerEdit, WM_PASTE, 0, 0);
else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
SendMessage(selection.hwndSelectionMarkerEdit, WM_PASTE, 0, 0);
else
splicer.PasteInsert();
splicer.PasteInsert();
break;
case ACCEL_CTRL_DELETE:
case ID_EDIT_DELETE:
@ -983,22 +959,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
splicer.InsertFrames();
break;
case ACCEL_DEL:
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
{
DWORD sel_start, sel_end;
SendMessage(playback.hwndPlaybackMarkerEdit, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
if (sel_start == sel_end)
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETSEL, sel_start, sel_start + 1);
SendMessage(playback.hwndPlaybackMarkerEdit, WM_CLEAR, 0, 0);
} else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
{
DWORD sel_start, sel_end;
SendMessage(selection.hwndSelectionMarkerEdit, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
if (sel_start == sel_end)
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETSEL, sel_start, sel_start + 1);
SendMessage(selection.hwndSelectionMarkerEdit, WM_CLEAR, 0, 0);
} else
splicer.ClearFrames();
splicer.ClearFrames();
break;
case ID_EDIT_CLEAR:
case ID_CONTEXT_SELECTED_CLEARFRAMES:
@ -1181,11 +1142,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
taseditor_window.UpdateCheckedItems();
break;
case ACCEL_CTRL_A:
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETSEL, 0, -1);
else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETSEL, 0, -1);
else if (piano_roll.drag_mode != DRAG_MODE_SELECTION && piano_roll.drag_mode != DRAG_MODE_DESELECTION)
if (piano_roll.drag_mode != DRAG_MODE_SELECTION && piano_roll.drag_mode != DRAG_MODE_DESELECTION)
selection.SelectBetweenMarkers();
break;
case ID_EDIT_SELECTMIDMARKERS:
@ -1200,25 +1157,12 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break;
case ACCEL_CTRL_Z:
case ID_EDIT_UNDO:
{
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
{
SendMessage(playback.hwndPlaybackMarkerEdit, WM_UNDO, 0, 0);
} else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
{
SendMessage(selection.hwndSelectionMarkerEdit, WM_UNDO, 0, 0);
} else
{
history.undo();
}
break;
}
history.undo();
break;
case ACCEL_CTRL_Y:
case ID_EDIT_REDO:
{
history.redo();
break;
}
history.redo();
break;
case ID_EDIT_SELECTIONUNDO:
case ACCEL_CTRL_Q:
{
@ -1300,30 +1244,14 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break;
case ACCEL_HOME:
{
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETSEL, 0, 0);
else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETSEL, 0, 0);
else
// scroll Piano Roll to the beginning
ListView_Scroll(piano_roll.hwndList, 0, -piano_roll.list_row_height * ListView_GetTopIndex(piano_roll.hwndList));
// scroll Piano Roll to the beginning
ListView_Scroll(piano_roll.hwndList, 0, -piano_roll.list_row_height * ListView_GetTopIndex(piano_roll.hwndList));
break;
}
case ACCEL_END:
{
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
{
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETSEL, 0, -1);
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETSEL, -1, -1);
} else if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
{
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETSEL, 0, -1);
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETSEL, -1, -1);
} else
{
// scroll Piano Roll to the end
ListView_Scroll(piano_roll.hwndList, 0, piano_roll.list_row_height * currMovieData.getNumRecords());
}
// scroll Piano Roll to the end
ListView_Scroll(piano_roll.hwndList, 0, piano_roll.list_row_height * currMovieData.getNumRecords());
break;
}
case ACCEL_PGUP:
@ -1392,9 +1320,11 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break;
case ACCEL_CTRL_LEFT:
case ACCEL_SHIFT_LEFT:
{
// scroll Piano Roll horizontally to the left
ListView_Scroll(piano_roll.hwndList, -COLUMN_BUTTON_WIDTH, 0);
break;
}
case ACCEL_CTRL_RIGHT:
case ACCEL_SHIFT_RIGHT:
// scroll Piano Roll horizontally to the right

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
//#define PUBLIC_RELEASE // uncommend this when making a public release, but comment back before committing
//#define PUBLIC_RELEASE // uncomment this when making a public release, but comment back before committing
#ifndef __FCEU_VERSION
#define __FCEU_VERSION