Traverse from one cube room to another cube room with the help of keys

Using
document.addEventListener('keydown', function( e ) { ... } you can relize movements.

An example from the collection:

MultiFormGeometry


document.addEventListener('keydown', function( e ) {
    
    if ( e.keyCode === 37 ) staticMesh.position.x -= 0.1; // arrow keys
    if ( e.keyCode === 38 ) staticMesh.position.y += 0.1;
    if ( e.keyCode === 39 ) staticMesh.position.x += 0.1;
    if ( e.keyCode === 40 ) staticMesh.position.y -= 0.1;
    
    if ( e.keyCode === 76 ) { // l left 
        
        rot +=0.03;
        staticMesh.rotation.z = rot;
        
    }
    
    if ( e.keyCode === 82 ) { // r right
        
        rot -=0.03;
        staticMesh.rotation.z = rot;
        
    }
    
} );