That's kind of the idea indeed.
Each tick check if you have currently expected input pressed. Save the key code or the "meaning" you intend the input to have in an array.
Then run this array through a function/group that is meant to "translate" this array to moves in your game.
Be sure to clear the oldest entry(ies) of the array on a regular basis. (You may need to save the timestamp for the input when setting the input value into the array to make sure you keep the duration consistent).