You could increase the deadband of the axis you do not want input from and test the other axis that way.
There probably is a method to use with keyboard only but IMO the first one seems better and easier.
Also, I believe any keyboard command would be incremental and not be full left or right.