diff --git a/osu.Game/Input/Bindings/DatabasedKeyBinding.cs b/osu.Game/Input/Bindings/DatabasedKeyBinding.cs
index c0cecf361d..7e9e25aeff 100644
--- a/osu.Game/Input/Bindings/DatabasedKeyBinding.cs
+++ b/osu.Game/Input/Bindings/DatabasedKeyBinding.cs
@@ -3,11 +3,12 @@
using System.ComponentModel.DataAnnotations.Schema;
using osu.Framework.Input.Bindings;
+using osu.Game.Database;
namespace osu.Game.Input.Bindings
{
[Table("KeyBinding")]
- public class DatabasedKeyBinding : KeyBinding
+ public class DatabasedKeyBinding : KeyBinding, IHasPrimaryKey
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ID { get; set; }
diff --git a/osu.Game/Input/KeyBindingStore.cs b/osu.Game/Input/KeyBindingStore.cs
index 53309fc72d..e21597130a 100644
--- a/osu.Game/Input/KeyBindingStore.cs
+++ b/osu.Game/Input/KeyBindingStore.cs
@@ -60,7 +60,7 @@ namespace osu.Game.Input
}
///
- /// Retrieve s for a specified ruleset/variant content.
+ /// Retrieve s for a specified ruleset/variant content.
///
/// The ruleset's internal ID.
/// An optional variant.
@@ -70,8 +70,13 @@ namespace osu.Game.Input
public void Update(KeyBinding keyBinding)
{
+ var dbKeyBinding = (DatabasedKeyBinding)keyBinding;
+
var context = GetContext();
- context.Update(keyBinding);
+
+ Refresh(ref dbKeyBinding);
+
+ context.Update(dbKeyBinding);
context.SaveChanges();
KeyBindingChanged?.Invoke();