Remote or Proxy keyboard hardware device - keyboard

Is there a way to replace a standard USB cabled keyboard and mouse with a device that can simulate that hardware (without installing any additional software on the device would normally have had the standard keyboard & mouse connected) but be operated over WAN from any remote location?
i.e. a remote keyboard rather than a remote desktop

Related

Can a USB 3 Host machine be programmed as a USB 3 Peripheral (or a HID keyboard)?

What I want to do:
An AI program on a host machine, reading inputs from a camera sensing the screen of the target machine and outputting controls to the target machine via USB connection--programming the host machine's USB host as a USB peripheral connected to the target machine.
What I want to do step by step: (is it possible to implement the steps below?)
Have a host machine A and a target machine B.
Connect A and B with a USB 3.0 Type-A male-male cable.
The USB connection shows up as an HID keyboard device on B.
Write code to simulate key presses on A that sends to B.
(Eg. calling press('F') on a program running on A would type F to B's input)
It shouldn't require any program installed on B.
What I already searched:
USB 3.0 Host to host connection is possible:
https://superuser.com/questions/795053/how-do-i-connect-two-computers-using-usb-3-0
USB 2.0 Host to host connection is impossible:
https://superuser.com/questions/99274/how-to-connect-two-computers-with-usb
Similar questions asked without the assumption that USB 3.0 Host to Host connection is possible:
https://superuser.com/questions/1128365/simulate-usb-keyboard-from-machine
Setting up a computer to act as an HID device connected to another computer via ps/2,usb or another wired connection
https://superuser.com/questions/507921/computer-to-act-as-keyboard?rq=1
Suggestions in ascending order of feasibility:
USB Gadgets
You are using linux, so the default way would be to create/configure/load a gadget driver. Have a look at this tutorial, though for a raspberry, should work on your PC too. However, I could not find any information regarding the use of USB3 - the tutorial assumes your host is using one of it's OTG ports, which your PC most likely does not have. So whether this works with your USB3.1 Type-A-to-Type-A connection you'll need to test.
USBIP
The idea of sharing USB devices (not just keyboards) is not really new. With USBIP you can "export" any local USB device to the network, and your client will need the client-side USBIP driver to access the keyboard.
Dont bother with USB at all, just use Ethernet
I'd simply write two userland scripts/programs that send/receive+execute the keystrokes. Very easy to implement, you're probably familiar with python anyway.
If you absolutely cant have software installed on the client-PC and your Type-C-to-Type-C connection doesnt support USB Gadgets, there's another way. It basically involves the use of two USB-to-serial adapters (~15$) and a serial cable. While this wont be enumerated as a keyboard, but rather as serial port, it's the lowest-effort solution to transfer data without additional software on the client. Both computers will just do file I/O. If your computers still have COM-ports, you can even omit the serial converters!

Pair with noinputnooutput remote bluetooth device

I want to pair my PC with a remote bluetooth device whose IO capacity is set as "noinputnooutput" as this device has neither keyboard nor display but my PC always generates a pin code to support from the remote device or asks me to put the pin code of the remote device which is not exist. Now I want to make this pair without any pin code. Is there any configuration in my PC to do that?
I'm trying from Ubuntu 17.10 also I tried it from windows machine

RN-42 HID: from keyboard to mouse

I am working with an Arduino micro and RN-42 Bluetooth module. I have set the BT module as an HID keyboard by sending the commands through a terminal (using a COM port).
I want to set the device as a mouse but, now that it is in HID mode, I can't use a terminal.
How do I send the commands to set it as a mouse?
Thank you.
As your device now identifies itself as an HID device, the system no longer creates a corresponding tty file. I am not sure if it is a policy (meaning it doesn't do it because it would not make sense) or a mechanism issue (meaning it's just not able to do serial communication with a device using HID profile).
All you need is a serial console. Get a USB to serial/TTL adapter, your serial adapter will have a corresponding tty file that you can open as a serial console and you will be able to output commands directly to the RN42's UART, just as you used to over Bluetooth.

Make your computer discoverable

my .net app on the computer needs to make the computer discoverable, start a service and then wait to accept incoming connections. my app/computer is the slave and connecting device is the master. So I change my local radio mode to discoverable programmatically,start my service and wait... But when the device is supposed to connect to my app/computer, nothing happens.
Windows help and support has this :
Control Panel ->search for bluetooth -> click on change bluetooth settings ->
To make your computer discoverable to Bluetooth enabled devices,
select the check box for Allow Bluetooth devices to find this computer.
When a Bluetooth enabled computer is in discovery mode, it broadcasts a
wireless signal that allows it to be detected by other computers or devices.
This is sometimes called pairing mode. If you check this box, your computer
will still be able to detect Bluetooth enabled devices that are in discovery mode,
but they will not be able to detect your computer.
I am not quite sure what's the context. If I leave that box checked, then other devices will be able to detect me (because I am set to discoverable), but won't be able to connect????? So my service just keeps listening, won't be able to detect any incoming requests? Am I right?

How to send keystrokes from one computer to another by USB?

Is there a way to use one computer to send keystrokes to another by usb ?
What i'm looking to do is to capture the usb signal used by a keyboard (with USBTrace for example) and use it with PC-1 to send it to PC-2.
So that PC-2 reconize it as a regular keyboard input.
Some leads to do this would be very appreciated.
What you essentially need is a USB port on PC-1 that will act as a USB device for PC-2.
That is not possible for the vast majority of PC systems because USB is an asymmetric bus, with a host/device (or master/slave, if you wish) architecture. USB controllers (and their ports) on most PCs can only work in host mode and cannot simulate a device.
That is the reason that you cannot network computers through USB without a special cable with specialised electronics.
The only exception is if you somehow have a PC that supports the USB On-The-Go standard that allows for a USB port to act in both host and device mode. USB-OTG devices do exist, but they are usually embedded devices (smartphones etc). I don't know if there is a way to add a USB-OTG port to a commodity PC.
EDIT:
If you do not need a keyboard before the OS on PC-2 boots, you might be able to use a pair of USB Bluetooth dongles - one on each PC. You'd have to use specialised software on PC-1, but it is definitely possible - I've already seen a possible implementation on Linux, and I am reasonably certain that there must be one for Windows. You will also need Bluetooth HID drivers on PC-2, if they are not already installed.
On a different note, have you considered a purely software/network solution such as TightVNC?
There is a solution:
https://github.com/Flowm/etherkey
This uses a network connection from your computer to the raspi which is connected to a teensy (usb developer board) to send the key strokes.
This solution is not an out-of-the-box product. The required skill is similar to programming some other devices like arduino. But it's a complete and working setup.
The cheapest options are commercial microcontrollers (eg arduino platform, pic, etc) or ready built usb keyboard controllers (eg i-pac, arcade controllers,etc)
SEARCH THIS PROGRAM:
TWedge: Keyboard Wedge Software (RS232, Serial, TCP, Bluetooth)
then, MAKE YOUR OWN CONNECTION CABLE WITH:
(usb <-> rs232) + (NULL MODEM) + (rs232 <-> usb)
Connect 2 computer, write your own program to send signal to your (usb <-> rs232) unit, then you can control another computer under the help of TWedge.
The above mentionned https://github.com/Flowm/etherkey is one way. The keyboard is emulated from an rPi, but the principle can be used from PC to PC (or Mac to Whatever). The core answer to your question is to use an OTG-capable chip, and then you control this chip via a USB-serial adapter.
https://euer.krebsco.de/a-software-kvm-switch.html
uses a very similar method, using an Arduino instead of the Teensy.
The generic answer is: you need an OTG capable, or slave capable device: Arduino, Teensy, Pi 0 (either from Rapberry or Orange brands, both work; only the ZERO models are OTG capable), or, an rPi-A with heavy customisation (since it does not include USB hub, it can theoretically be converted into a slave; never found any public tutorial to do it), or any smartphone (Samsung, Nokia, HTC, Oukitel ... most smartphones are OTG capable). If you go for a Pi or a phone, then, you want to dig around USB Gadget. Cheaper solutions (Arduino/Teensy) need custom firmware.

Resources