From 8e975edfadc068f9cc603d7c8b5f27067371161f Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sun, 15 Oct 2006 21:11:13 +0300 Subject: add support for extended devices Add a -device parameter, which allows setting the map on arbitary extended devices. --- setxkbmap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setxkbmap.c b/setxkbmap.c index 5f64d85..83083eb 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -118,6 +118,8 @@ char ** inclPath= NULL; XkbDescPtr xkb= NULL; +int deviceSpec = XkbUseCoreKbd; + /***====================================================================***/ #define streq(s1,s2) (strcmp(s1,s2)==0) @@ -204,6 +206,7 @@ usage(int argc,char **argv) MSG("-?,-help Print this message\n"); MSG("-compat Specifies compatibility map component name\n"); MSG("-config Specifies configuration file to use\n"); + MSG("-device Specifies the device ID to use\n"); MSG("-display Specifies display to use\n"); MSG("-geometry Specifies geometry component name\n"); MSG("-I[] Add to list of directories to be used\n"); @@ -334,6 +337,8 @@ unsigned present; ok= setOptString(&i,argc,argv,COMPAT_NDX,FROM_CMD_LINE); else if (streq(argv[i],"-config")) ok= setOptString(&i,argc,argv,CONFIG_NDX,FROM_CMD_LINE); + else if (streq(argv[i],"-device")) + deviceSpec= atoi(argv[++i]); else if (streq(argv[i],"-display")) ok= setOptString(&i,argc,argv,DISPLAY_NDX,FROM_CMD_LINE); else if (streq(argv[i],"-geometry")) @@ -811,7 +816,7 @@ applyComponentNames(void) cmdNames.keycodes= svValue[KEYCODES_NDX]; cmdNames.geometry= svValue[GEOMETRY_NDX]; cmdNames.keymap= svValue[KEYMAP_NDX]; - xkb= XkbGetKeyboardByName(dpy,XkbUseCoreKbd,&cmdNames, + xkb= XkbGetKeyboardByName(dpy,deviceSpec,&cmdNames, XkbGBN_AllComponentsMask, XkbGBN_AllComponentsMask&(~XkbGBN_GeometryMask), True); -- cgit v1.2.3