If you want to learn what you could probably do would be to pick a microcontroller that would behave like a USB host on one end (to plug the keyboard in the microcontroller and make the keyboard think it's connected to computer) . Microcontroller would perhaps run at only USB 1.1 (10mbps) but should be enough for a keyboard, and even for a mouse (the 1000 polling rate may be an issue, bit for 125 hz updates it would probably be fine.
raspberry pi3 would probably super cheap and easy and overkill
The microcontroller would get the keyboard/mouse data and arrange it in packets and send it to another microcontroller on the other end through RS-485 or RS-232 .. over 1-2 pairs of ethernet cable, leaving the other pairs to send power to the other end of the cable
At the other end of the cable , one or two microcontroller could be configured as HID (human interface devices), keyboards, mice etc and just pick keyboard data packets or mouse data packets and convert them back to usb messages and give them to computer.
Even a low 115 kbps baud rate shouldn't be a problem to send some keys over or some mouse movement.