Rotating viewport in threejs on keyboard like in threejs holding left mouse's key event

like in this case:

but when rotating camera target then there should be an option to move forward/backward/left/right into side of camera target, not an original side
and there is a bug with using left mouse, it breaks position to original value in some cases