I was messing around with inventory mechanics, here's what I've done. You can probably use it in your game, but there are some pretty annoying bugs that i'm too lazy to fix Item textures yoinked from Factorio, GUI drawn by me
Just drag around these items [e] to open inventory [space] to split one from stack [1, 2, 3...] to choose item from hotbar