PORTS Forum
Ports and Interfaces => USB => Topic started by: hassanayoub85 on October 19, 2012, 02:18:03 pm
-
Hello experts,
Can i use your USB control for c# to give my PC keyboard strokes form .net application running ona tablet PC?Like by pressing a button on a tablet pc, it will send Ctrl+Esc to the PC.
Thx in advanced
-
SendKeys can send keystrokes:
http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx
-
Thx for it, but I know it.
This will work well if the keystrokes sender application is hosted on the same PC where the application which I want to apply the strokes on is.
While my scenario is different:
1- PC have an application running.
2- Tablet PC have the key strokes application running.
I want to press a button on the tablet PC which is connected through usb to the PC, then the main applicaiton on the PC will get this strokes (Shift+1, Ctrl+ESC) and act with it.
So simple, the tablet pc should be a keyboard for the normal PC.
-
To communicate with the PC, the tablet PC would need to have a USB device port so you can attach a USB cable.
You might look into sending the codes via a network interface, then use SendKeys to send the codes to an application.
-
I see, and that's what I am searching for!!!
How can I send commands from tablet to ps through usb?
Dont i need a control like yours?
-
You can't do it directly unless your tablet PC has a USB device or OTG port. A device port has a series-B, mini-B, or micro-B connector. An OTG port has a mini-AB or micro-AB connector:
http://www.cablestogo.com/resources/usb.asp
You could use a PC/PC USB bridge cable to create a network connection between the PCs:
http://www.hardwaresecrets.com/article/Connecting-Two-PCs-Using-a-USB-USB-Cable/248
-
So do u mean, I use the usb cable to make a network by tablet and pc, or even using normal network cable.
And then develop the application to send data as sockets like client server application, then I sendkeystrokes on the PC which are recieved by network (USB or lan) from the tablet?
-
Yes, that's the only way I can think of offhand to do it.
-
Ok i see.
So where is the usage of yur usb control?
Doesnt it work like serial control? so i can easly select the serial port and pass the key to it?
-
If you mean my USB HID example application, my HID page has example firmware with descriptors for a HID that sends and receives vendor-defined data.
http://www.lvr.com/hidpage.htm#MyExampleCode
A HID is not a USB virtual serial port device, which functions at the application level just like a physical serial port device: it can send and receive any type of data.
-
So cant I use your control to hande the usb on bothe sides, and by then exchange data?
-
No, you would need the tablet PC to function as a HID device, and the tablet PC likely only has a USB host port.
A USB bridge cable creates a network connection.
Not to confuse the issue, but you can also use two USB/serial adapters with a null modem adapter in between. Then the two PCs can communicate over virtual COM ports.
-
I see.
Thx alot for your cooperation and help, u r really an expert.
Just last thing.
So where is the usage of your USb control?
-
My HID page has example firmware with descriptors for a HID that sends and receives vendor-defined data.
http://www.lvr.com/hidpage.htm#MyExampleCode
Devices that use this firmware can communicate with my example PC generic HID application, as can other HIDs except system keyboards and mice.
-
mmm, it's ok.
Thx alot