Use a media keyboard with your pHat Beat, can it be done?

I edited it to this and it now passes the check module function in idle3. Will run it on my Pi latter on tonight to see what happens.

import usb.core
import usb.util
import time

USB_IF = 0 # Interface
USB_TIMEOUT = 5 # Timeout in MS

USB_VENDOR = 0x1997 # Rii
USB_PRODUCT = 0x2433 # Mini Wireless Keyboard

dev = usb.core.find(idVendor=USB_VENDOR, idProduct=USB_PRODUCT)

endpoint = dev[0][(0,0)][0]

if dev.is_kernel_driver_active(USB_IF) is True:
dev.detach_kernel_driver(USB_IF)

usb.util.claim_interface(dev, USB_IF)

while True:
control = None

try:
control = dev.read(endpoint.bEndpointAddress, endpoint.wMaxPacketSize, USB_TIMEOUT)
print (control)
except:
pass

time.sleep(0.01) # Let CTRL+C actually exit

I can’t find the code tags?