Re: logitech cordless desktop deluxe optical keyboard issues

From: Andries Brouwer
Date: Sun Jan 11 2004 - 11:33:50 EST


On Sun, Jan 11, 2004 at 05:05:06PM +0100, sven kissner wrote:

> sure but it's not working:

> # setkeycodes 91 120
> setkeycode: code outside bounds

Hm, yes. What about this version?

-------- sk.c -------
/*
* call: sk scancode keycode
* (where scancode is given in hexadecimal, and keycode in decimal)
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <linux/kd.h>

int
main(int argc, char **argv) {
struct kbkeycode a;
char *ep;

if (argc != 3) {
fprintf(stderr, "Call: sk scancode keycode\n");
exit(1);
}

a.scancode = strtol(argv[1], &ep, 16);
a.keycode = atoi(argv[2]);

if (ioctl(0, KDSETKEYCODE, &a)) {
perror("KDSETKEYCODE");
fprintf(stderr, "failed to set scancode 0x%x to keycode %d\n",
a.scancode, a.keycode);
exit(1);
}

return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/