Minecraft input keys glitch in creative

Recently, when working in my creative world, I have encountered a bug where, after a while of playing (~1h roughly), the keys are "randomised". Essentially, when I press W, it drops an item. When I press something like S it does something else. This only happens in creative mode, and I can't find any answers online about this. I didn't mess around with key binds.

It happens both on regular and with Optifine. When the glitch occurs, other apps and games work just fine.


Solution 1:

Let me guess: this happens after you try to attach something to a container, while flying (creative flight).

ctrl+shift allows you to attach things to containers without opening them, and without changing altitude. It also changes keyboard layout in Windows. I guess you have two or more keyboards configured and the other keyboard layout is not QWERTY or anything close. Remove or disable the other keyboard through Language settings.