Player APIs (BrightScript & Ja...
...
Object Reference
Input/Output Objects

roUsbHidEmulator

6min
this object allows you to emulate usb hid devices, but currently, the only supported type of device is a usb keyboard when operating on an xt1145 or xt2145 on bos version 9 0 157 or later, this code must be added in order to use this object 'updated code needed for new firmware dc=createobject("rodevicecustomization") dc configureasusbgadget(1) brightsign players with usb c (except for ls3 and ls4) can use this object usb keyboard codes are different from ps/2, ascii, and brightsign keyboard codes ifusbhidemulator enable() as boolean enables the hid device this method returns true on success if there's a failure, use getfailurereason() to get the reason for the failure keydown(a as integer) as boolean sends a keydown event for the specified usb key code this method returns true on success if there's a failure, use getfailurereason() to get the reason for the failure usb keyboards only have 6 key rollover, therefore only six keys can be down at one time keyup(a as integer) as boolean sends a keyup event for the specified usb key code this method returns true on success, and returns fails on failure (e g if the specified key was not already down) if there's a failure, use getfailurereason() to get the reason for the failure keypress(a as integer) as boolean equivalent to keydown(key code) followed by keyup(key code) this method allows you to avoid leaving keys stuck down clear() as boolean clears all active keystrokes and modifiers getmodifierstate() as object returns an associative array with the current state of all modifiers (i e shift, alt, ctrl) setmodifierstate(a as object) as boolean sets the current modifier state as specified by an associative array only modifiers that are listed will cause the state to change modifiers will persist until changed or clear() is called example hidkey setmodifierstate({ leftshift true }); getledstate() as object returns an associative array with the current state of all led states on the keyboard the host may send an led state change if a lock key (i e number lock, capital lock, scrolling lock) is pressed, generating the rousbhidledemulatorevent docid\ kmqrsgxeyhahpvhlsvuad object the getledstate() method can be used to get the current led state without using an event ifuserdata setuserdata(user data as object) sets the user data that will be returned when events are raised getuserdata() as object returns the user data that has previously been set via setuserdata() it will return invalid if no data has been set ifmessageport setport(port as romessageport) posts messages of type rousbhidemulatorledevent to the attached message port iffailurereason getfailurereason() as string returns additional information if a method fails