Main Site Documentation

How to emulate keyboard and mouse simultanously


I want to have the same USb Client DP to emulate a mouse and a keyboard.
how can I emulate both keyboard and mouse simultaneously?
for emulating keyboard/ mouse there the guide
can this be done?


I believe this is not supported.


Is there any way to connect 2 Usb Clients in order to get this functionality with one main board?


I don’t have a definitive answer for you; only an idea or two…

— I don’t know HID or custom USB devices but this would at least eliminate a lot of the PC side —
[ul]Choose an existing keyboard product that has a built-in touchpad or trackball
Hijack the USB parameters from the driver and create a USBC_Device using them
That should trick the PC into identifying the FEZ as whichever keyboard you picked
Mimic the datastream from the actual device <-- lost here; no clue how[/ul]

– Abstraction of intent
The dongles that come with wireless mice, keyboards, and combos function like a USB hub except that it has 2.4GHz radios instead of actual USB ports.
Can you, perhaps, host a similar virtual hub and then fake it into “connecting” a keyboard and mouse to it?
Does USBC even emulate hubs?


@ Devloper123 - Just found this…

ushort myVID = 0x1234;
ushort myPID = 0x0001;
ushort myDeviceVersion = 0x100;
ushort myDeviceMaxPower = 250; // in milli amps
string companyName = "My Company";
string productName = "My Product";
string myDeviceSerialNumber = "0";

// Create the device
USBC_Device device = new USBC_Device(myVID, myPID, myDeviceVersion, myDeviceMaxPower, companyName, productName, myDeviceSerialNumber);

// Add a CDC device
USBC_CDC cdc = new USBC_CDC(device, "My CDC Interface");

// Add a Keyboard
USBC_Keyboard kb = new USBC_Keyboard(device, "My KB Interface");

// You can even add custom interfaces.

// When ready, you can start your device as follows:

Try hijacking existing product and piping keyboard to interface1 and mouse to 2 and swap if they backwards.


@ Devloper123 - Assuming you get this working, how would you push keys on the keyboard and/or move the mouse?