--- a/net/minecraft/client/gui/screen/ControlsScreen.java
+++ b/net/minecraft/client/gui/screen/ControlsScreen.java
@@ -33,7 +33,7 @@
       this.field_230705_e_.add(this.field_146494_r);
       this.field_146493_s = this.func_230480_a_(new Button(this.field_230708_k_ / 2 - 155, this.field_230709_l_ - 29, 150, 20, new TranslationTextComponent("controls.resetAll"), (p_213125_1_) -> {
          for(KeyBinding keybinding : this.field_228183_b_.field_74324_K) {
-            keybinding.func_197979_b(keybinding.func_197977_i());
+            keybinding.setToDefault();
          }
 
          KeyBinding.func_74508_b();
@@ -57,11 +57,14 @@
    public boolean func_231046_a_(int p_231046_1_, int p_231046_2_, int p_231046_3_) {
       if (this.field_146491_f != null) {
          if (p_231046_1_ == 256) {
+            this.field_146491_f.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), InputMappings.field_197958_a);
             this.field_228183_b_.func_198014_a(this.field_146491_f, InputMappings.field_197958_a);
          } else {
+            this.field_146491_f.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), InputMappings.func_197954_a(p_231046_1_, p_231046_2_));
             this.field_228183_b_.func_198014_a(this.field_146491_f, InputMappings.func_197954_a(p_231046_1_, p_231046_2_));
          }
 
+         if (!net.minecraftforge.client.settings.KeyModifier.isKeyCodeModifier(this.field_146491_f.getKey()))
          this.field_146491_f = null;
          this.field_152177_g = Util.func_211177_b();
          KeyBinding.func_74508_b();
