diff --git a/BAKKA-Editor/MainForm.Designer.cs b/BAKKA-Editor/MainForm.Designer.cs index 4a363a9..f6fd2da 100644 --- a/BAKKA-Editor/MainForm.Designer.cs +++ b/BAKKA-Editor/MainForm.Designer.cs @@ -801,7 +801,7 @@ this.playButton.Name = "playButton"; this.playButton.Size = new System.Drawing.Size(86, 23); this.playButton.TabIndex = 0; - this.playButton.Text = "Play (P)"; + this.playButton.Text = "Play"; this.playButton.UseVisualStyleBackColor = true; this.playButton.Click += new System.EventHandler(this.playButton_Click); // diff --git a/BAKKA-Editor/MainForm.cs b/BAKKA-Editor/MainForm.cs index 950b6db..a77dea0 100644 --- a/BAKKA-Editor/MainForm.cs +++ b/BAKKA-Editor/MainForm.cs @@ -125,6 +125,7 @@ namespace BAKKA_Editor blueButton.AppendHotkey(userSettings.HotkeySettings.SnapDownHotkey); chainButton.AppendHotkey(userSettings.HotkeySettings.ChainHotkey); holdButton.AppendHotkey(userSettings.HotkeySettings.HoldHotkey); + playButton.AppendHotkey(userSettings.HotkeySettings.PlayHotkey); // Look for temp files from previous runs var tempFile = Directory.GetFiles(Path.GetTempPath(), "*.bakka"); @@ -932,14 +933,15 @@ namespace BAKKA_Editor currentSong.Paused = !currentSong.Paused; if (currentSong.Paused) { - playButton.Text = "Play (P)"; + playButton.Text = "Play"; updateTimer.Enabled = false; } else { - playButton.Text = "Pause (P)"; + playButton.Text = "Pause"; updateTimer.Enabled = true; } + playButton.AppendHotkey(userSettings.HotkeySettings.PlayHotkey); } } @@ -1695,11 +1697,6 @@ namespace BAKKA_Editor insertButton_Click(sender, e); insertButton.Focus(); return true; - case Keys.P: - if (playButton.Enabled) - playButton_Click(sender, e); - playButton.Focus(); - return true; case Keys.Up | Keys.Shift: /* Fallthrough */ case Keys.Down | Keys.Shift: @@ -1756,6 +1753,13 @@ namespace BAKKA_Editor holdButton.Focus(); return true; } + else if (keyData == (Keys)userSettings.HotkeySettings.PlayHotkey) + { + if (playButton.Enabled) + playButton_Click(sender, e); + playButton.Focus(); + return true; + } break; } diff --git a/BAKKA-Editor/UserSettings.cs b/BAKKA-Editor/UserSettings.cs index 85c3c73..8823a35 100644 --- a/BAKKA-Editor/UserSettings.cs +++ b/BAKKA-Editor/UserSettings.cs @@ -37,5 +37,6 @@ namespace BAKKA_Editor public int SnapDownHotkey { get; set; } = Convert.ToInt32(Keys.D5); public int ChainHotkey { get; set; } = Convert.ToInt32(Keys.D6); public int HoldHotkey { get; set; } = Convert.ToInt32(Keys.D7); + public int PlayHotkey { get; set; } = Convert.ToInt32(Keys.Space); } } diff --git a/BAKKA-Editor/Utils.cs b/BAKKA-Editor/Utils.cs index 2718a83..6f186ea 100644 --- a/BAKKA-Editor/Utils.cs +++ b/BAKKA-Editor/Utils.cs @@ -181,18 +181,14 @@ namespace BAKKA_Editor internal static string KeyIntToString(int key) { - int offset = 0; - char ret = '0'; + // Gets the key name from the keycode + string val = ((Keys)key).ToString(); + // Converts digit keycode into number instead of key name if (key >= 48 && key <= 57) { - offset = key - 48; + val = $"{key - 48}"; } - else if (key >= 65 && key <= 90) - { - offset = key - 65; - ret = 'A'; - } - return ((char)(ret + offset)).ToString(); + return val; } internal static void AppendHotkey(this Button button, int key)