Just so I don't lose the code again ... johannes #include <stdio.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> #include <linux/uinput.h> int main(int argc, char **argv) { struct uinput_user_dev dev; struct input_event ev; int fd, ret; fd = open("/dev/input/uinput", O_WRONLY); if (fd < 0) { perror("open"); if (errno == ENOENT) fprintf(stderr, "Try to \"modprobe uinput\".\n"); return 1; } /* set up virtual device */ memset(&dev, 0, sizeof(dev)); strcpy(dev.name, "virt-rfkill"); ioctl(fd, UI_SET_EVBIT, EV_KEY); ioctl(fd, UI_SET_KEYBIT, KEY_WLAN); ret = write(fd, &dev, sizeof(dev)); if (ret != sizeof(dev)) { perror("write setup"); return 1; } /* register device */ ret = ioctl(fd, UI_DEV_CREATE); if (ret) { perror("create"); return 1; } /* write event */ memset(&ev, 0, sizeof(ev)); ev.type = EV_KEY; ev.code = KEY_WLAN; ret = write(fd, &ev, sizeof(ev)); if (ret != sizeof(ev)) { perror("write event"); return 1; } return 0; } -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html