package net.minecraft.client.input;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

@Environment(EnvType.CLIENT)
public record KeyInput(int key, int scancode, int modifiers) {
   public boolean hasCtrl() {
      return (this.modifiers & 2) != 0;
   }

   public boolean hasShift() {
      return (this.modifiers & 1) != 0;
   }

   public boolean isSelectAll() {
      return this.hasCtrl() && this.key == 65;
   }

   public boolean isCopy() {
      return this.hasCtrl() && this.key == 67;
   }

   public boolean isPaste() {
      return this.hasCtrl() && this.key == 86;
   }
}
