Minor corrections to switching HDMI port. Also added code to work out
keyboard and mouse devices.  Not tested yet