void loop() {
if (millis() - last_key_press > 350) read_keyboard();
delay(50);
}
That delay() is stupid. Why do you care how many times loop() iterates and does nothing?
if (digitalRead(buttonPin) == 0)
if (digitalRead(buttonPin2) == 0)
if(digitalRead(buttonPin)&&digitalRead(buttonPin2)==true)
Make up your mind. Either digitalRead() returns a numeric value (it does) or it returns a boolean (it does not). Don't mix types like that.
so while this key is pressed
We can't see what "key" you are pointing to.
I tried to use byte instead of char (so I can put the hexa code for the Left Shift key) but it returned me random characters...
Why did you think it was necessary to change types? A char holds a binary value in the range -128 to 127. The Keyboard library only supports values from 0 to 127.
but can't figure out how to do it with the shift register.
I don't think you can do "it" with a shift register. All those pins are going to hurt.
5th grade comments aside, WHAT can't you do with a shift register? There is NOTHING in your code that admits the existence of a shift register.