tastudio: move arrow keys logic to hotkeys
disallow sending Minus to MainForm
This commit is contained in:
parent
438e891358
commit
95dc2fd6b3
|
@ -229,6 +229,12 @@ namespace BizHawk.Client.Common
|
|||
Bind("TAStudio", "Insert Frame", "Insert"),
|
||||
Bind("TAStudio", "Delete Frames", "Ctrl+Delete"),
|
||||
Bind("TAStudio", "Clone Frames", "Ctrl+Insert"),
|
||||
Bind("TAStudio", "Analog Increment By One", "UpArrow"),
|
||||
Bind("TAStudio", "Analog Decrement By One", "DownArrow"),
|
||||
Bind("TAStudio", "Analog Increment By Ten", "Shift+UpArrow"),
|
||||
Bind("TAStudio", "Analog Decrement By Ten", "Shift+DownArrow"),
|
||||
Bind("TAStudio", "Analog Maximum", "RightArrow"),
|
||||
Bind("TAStudio", "Analog Minimum", "LeftArrow"),
|
||||
|
||||
Bind("SNES", "Toggle BG 1"),
|
||||
Bind("SNES", "Toggle BG 2"),
|
||||
|
|
|
@ -397,6 +397,30 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
||||
GlobalWin.Tools.TAStudio.CloneFramesExternal();
|
||||
break;
|
||||
case "Analog Increment By One":
|
||||
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
||||
GlobalWin.Tools.TAStudio.AnalogIncrementByOne();
|
||||
break;
|
||||
case "Analog Decrement By One":
|
||||
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
||||
GlobalWin.Tools.TAStudio.AnalogDecrementByOne();
|
||||
break;
|
||||
case "Analog Increment By Ten":
|
||||
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
||||
GlobalWin.Tools.TAStudio.AnalogIncrementByTen();
|
||||
break;
|
||||
case "Analog Decrement By Ten":
|
||||
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
||||
GlobalWin.Tools.TAStudio.AnalogDecrementByTen();
|
||||
break;
|
||||
case "Analog Maximum":
|
||||
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
||||
GlobalWin.Tools.TAStudio.AnalogMax();
|
||||
break;
|
||||
case "Analog Minimum":
|
||||
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
||||
GlobalWin.Tools.TAStudio.AnalogMin();
|
||||
break;
|
||||
|
||||
// SNES
|
||||
case "Toggle BG 1":
|
||||
|
|
|
@ -695,7 +695,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if(yield_alt) return false;
|
||||
var ts = ActiveForm as TAStudio;
|
||||
if(ts.IsInMenuLoop)
|
||||
if(ts.IsInMenuLoop || ts.FloatEditingMode)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -994,20 +994,47 @@ namespace BizHawk.Client.EmuHawk
|
|||
SetSplicer();
|
||||
}
|
||||
|
||||
private void TasView_KeyDown(object sender, KeyEventArgs e)
|
||||
public void AnalogIncrementByOne()
|
||||
{
|
||||
if (e.Control && !e.Shift && !e.Alt && e.KeyCode == Keys.Left) // Ctrl + Left
|
||||
{
|
||||
GoToPreviousMarker();
|
||||
}
|
||||
else if (e.Control && !e.Shift && !e.Alt && e.KeyCode == Keys.Right) // Ctrl + Right
|
||||
{
|
||||
GoToNextMarker();
|
||||
if (FloatEditingMode)
|
||||
EditAnalogProgrammatically(new KeyEventArgs(Keys.Up));
|
||||
}
|
||||
|
||||
// SuuperW: Float Editing
|
||||
if (FloatEditingMode)
|
||||
public void AnalogDecrementByOne()
|
||||
{
|
||||
if (FloatEditingMode)
|
||||
EditAnalogProgrammatically(new KeyEventArgs(Keys.Down));
|
||||
}
|
||||
|
||||
public void AnalogIncrementByTen()
|
||||
{
|
||||
if (FloatEditingMode)
|
||||
EditAnalogProgrammatically(new KeyEventArgs(Keys.Up | Keys.Shift));
|
||||
}
|
||||
|
||||
public void AnalogDecrementByTen()
|
||||
{
|
||||
if (FloatEditingMode)
|
||||
EditAnalogProgrammatically(new KeyEventArgs(Keys.Down | Keys.Shift));
|
||||
}
|
||||
|
||||
public void AnalogMax()
|
||||
{
|
||||
if (FloatEditingMode)
|
||||
EditAnalogProgrammatically(new KeyEventArgs(Keys.Right));
|
||||
}
|
||||
|
||||
public void AnalogMin()
|
||||
{
|
||||
if (FloatEditingMode)
|
||||
EditAnalogProgrammatically(new KeyEventArgs(Keys.Left));
|
||||
}
|
||||
|
||||
public void EditAnalogProgrammatically(KeyEventArgs e)
|
||||
{
|
||||
if (!FloatEditingMode)
|
||||
return;
|
||||
|
||||
float value = CurrentTasMovie.GetFloatState(_floatEditRow, _floatEditColumn);
|
||||
float prev = value;
|
||||
string prevTyped = _floatTypedValue;
|
||||
|
@ -1109,7 +1136,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
changeBy = 1; // We're assuming for now that ALL float controls should contain integers.
|
||||
else if (e.KeyCode == Keys.Down)
|
||||
changeBy = -1;
|
||||
if (e.Shift)
|
||||
if (Control.ModifierKeys == Keys.Shift)
|
||||
changeBy *= 10;
|
||||
value += changeBy;
|
||||
if (changeBy != 0)
|
||||
|
@ -1156,8 +1183,25 @@ namespace BizHawk.Client.EmuHawk
|
|||
DoTriggeredAutoRestoreIfNeeded();
|
||||
}
|
||||
}
|
||||
RefreshDialog();
|
||||
}
|
||||
|
||||
private void TasView_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Control && !e.Shift && !e.Alt && e.KeyCode == Keys.Left) // Ctrl + Left
|
||||
{
|
||||
GoToPreviousMarker();
|
||||
}
|
||||
else if (e.Control && !e.Shift && !e.Alt && e.KeyCode == Keys.Right) // Ctrl + Right
|
||||
{
|
||||
GoToNextMarker();
|
||||
}
|
||||
|
||||
if (FloatEditingMode &&
|
||||
e.KeyCode != Keys.Right && e.KeyCode != Keys.Left &&
|
||||
e.KeyCode != Keys.Up && e.KeyCode != Keys.Down)
|
||||
EditAnalogProgrammatically(e);
|
||||
|
||||
RefreshDialog();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue