Switching between USB Host Mode and USB Client mode in Arduino DUE

Hi,
I am connecting an external keyboard and PC to Arduino Due boards Native USB Using electronic switch (mux and de-mux).

The Problem:
I need to switch arduino Due between USB host mode and USB clint mode

CASE 1:
Using USB Host mode i am reading data from USB keyboard (its working fine)

CASE 2:
In this case i have to use same usb port in Client mode and sending some data to computer (Eg: to MS word or notepad)
( i am using electronic switch to isolate computer USB and keyboard USB, hence in case 1 due board is connected only to keyboard and case 2 Due board is connected only to computer )

Case 1 and Case 2 are working only in stand alone condition , that is either case 1 or case 2 .

But when i integrate both case 1 and case 2 , only case 1 is working case 2 is not working

Thus I conclude that when usb Host mode is initialized the arduino board is blocking usb Client feature.But In my project i need to switch between both mode regularly.

Please Help me resolve the problem.

Can you soft reboot when you switch mode and activate only case 1 or case 2.

Having both a the same time feels weird - for example because powering the usb in host mode.

Hi Sir, thank u for your reply.

I am powering my board through USB program port.

In single run time ( without resetting controller) I need to switch to host mode ( to read data from keyboard) then after few millisec I need to switch USB to Client mode ( to send data to PC through Native USB)

I am not using host mode and client mode at a time.

Please refer the attachment.