I want to control a motor from pc by assigning a key like "w". For example while I press "w" it will turn clock-wise. But it should be in real time, not like write "w" and press enter to make it work. It there any code I can do this? And also I want this to be wireless but not with bluetooth or wi-fi but probably with a good range transmitter/receiver. Do you have any advice how can I do it? I need to transfer data from arduino to pc and from pc to arduino simultaneously. For example while arduino sending me RPM of motor, I will be able to set the RPM by my pc.
You can do the "press a key and send it via serial" without the need to press return using a terminal emulator such as puTTY running on the PC or you could, of course, write something yourself in one of many languages, but I have no experience of wireless devices.
This question may be better in the Project Guidance section of the forum but please ask a moderator to move it rather than cross posting it there.
You can use one of the examples in serial input basics to receive the data in the Arduino. Then you need a PC program that can send the data in a suitable format.
This Python - Arduino demo may give you some ideas. The general approach is applicable in any language.