This is a common keyboard limitation. Either switch your keyboard binding to something that doesn't make the keyboard lock up or buy yourself a gamepad.
The latter option is the most optimal and the most recommended solution as N64 games were meant to be played with a gamepad with an analog stick.