I want to create a C program that accepts input from a joypad (/dev/input/js0), processes it, and then sends it to a fake device file (character or block) labeled as a keyboard (oh, and what is the device file for a keyboard?.  I would like to know if it is possible to do this, and if so, how.
How to create a fake device file that accepts input from a C program?
linux;c
Look closely at an excerpt from an ls -al /dev command on my system:brw-rw----  1 root floppy    8,   0 Jun  7 19:55 sdabrw-rw----  1 root floppy    8,   1 Jun  7 19:55 sda1brw-rw----  1 root floppy    8,   2 Jun  7 19:55 sda2brw-rw----  1 root floppy    8,   3 Jun  7 19:55 sda3brw-rw----  1 root floppy    8,   5 Jun  7 19:56 sda5brw-rw----  1 root floppy    8,   6 Jun  7 19:56 sda6brw-rw----  1 root floppy    8,   7 Jun  7 19:56 sda7brw-rw----  1 root floppy    8,   8 Jun  7 19:57 sda8brw-rw----  1 root floppy    8,  16 Jun  7 19:55 sdbbrw-rw----  1 root floppy    8,  32 Jun  7 19:55 sdcbrw-rw----  1 root floppy    8,  33 Jun  7 19:55 sdc1brw-rw----  1 root floppy    8,  34 Jun 11 10:39 sdc2brw-rw----  1 root floppy    8,  35 Jun  7 19:56 sdc3The two numbers after the group ID but before the date are the device file's major and minor numbers.  This is basically the kind of device it is.  8 in this case is a SCSI (or emulated SCSI) disk drive. http://lxr.linux.no/linux/Documentation/devices.txt is a somewhat not-so-recent list of all the major and minor numbers.  Not sure of the official location of the latest version of the list.So anyway, these files are created with the mknod command (mknod [OPTION]... NAME TYPE [MAJOR MINOR], some types are b for block, c for character).  There's also a mknod() system call.  I don't fully know the implications if you create another file with the same major/minor as an existing device. uinput as described in the comments is probably what you are looking for, although on PC hardware there is a /dev/psaux that reads/writes directly to the PS/2 port if your system is old enough to have one.  Could not even tell you where to begin with USB keyboards ...If you just want a fake device file and don't care what happens to the data you send to it, there's always /dev/zero.  Also symlinks may be a real simple solution in that case.