Listing 15. Mapping Keys

int codes[2];

codes[0] = 58; /* M keycap */
codes[1] = 49; /* assign to N */

if(ioctl(fd, EVIOCSKEYCODE, codes)) {
    perror("evdev ioctl");
}