Is using a computer mouse in the car legal? keyboard?

I'm using an android phone running samsung dex connected to a portable 17.3" monitor in the car a 2017 Honda Civic. I'm controlling the android device/monitor with a computer mouse. Is it legal to use a mouse for monitor control while in the car/driving? What about a keyboard?

I'll try to post a pic, when I get a chance. I know the tesla cyber truck has a 18.5" screen iside. I'm considering upgrading to a 18.5". A cop beside my side window was eyeing what is inside my car, as the slowed down, but had no issue.

I'm in Ontario, Canada.

Cheers,

Rev