diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-04-17 00:50:07 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2008-04-17 00:53:28 +0300 |
commit | a3a05fd489a9a35942a4419c537634e796dbebd1 (patch) | |
tree | e4ce2cc4433e33b9f7c884cadefa8020970dcd29 /xkbcomp.c | |
parent | be084fbeba28312fc5102e98d64726464032c3e8 (diff) |
xkbcomp: Take a device ID argument
Allows the user to set maps (or whatever) on arbitrary devices.
Diffstat (limited to 'xkbcomp.c')
-rw-r--r-- | xkbcomp.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -104,6 +104,7 @@ static Bool xkblist= False; static char * preErrorMsg= NULL; static char * postErrorMsg= NULL; static char * errorPrefix= NULL; +static unsigned int device_id = XkbUseCoreKbd; /***====================================================================***/ @@ -140,6 +141,7 @@ Usage(int argc,char *argv[]) M(" R: recursively list subdirectories\n"); M(" default is all options off\n"); } + M("-i <deviceid> Specifies device ID (not name) to compile for\n"); M("-m[ap] <map> Specifies map to compile\n"); M("-o <file> Specifies output file name\n"); if (!xkblist) { @@ -301,6 +303,13 @@ register int i,tmp; exit(1); } } + else if ((strncmp(argv[i], "-i", 2) == 0) && (!xkblist)) { + if (++i >= argc) { + if (warningLevel > 0) + WARN("No device ID specified\n"); + } + device_id = atoi(argv[i]); + } else if ((strncmp(argv[i],"-l",2)==0)&&(!xkblist)) { if (outputFormat!=WANT_DEFAULT) { if (warningLevel>0) { @@ -846,7 +855,7 @@ Status status; else if (inDpy!=NULL) { bzero((char *)&result,sizeof(result)); result.type= XkmKeymapFile; - result.xkb= XkbGetMap(inDpy,XkbAllMapComponentsMask,XkbUseCoreKbd); + result.xkb= XkbGetMap(inDpy,XkbAllMapComponentsMask,device_id); if (result.xkb==NULL) WSGO("Cannot load keyboard description\n"); if (XkbGetIndicatorMap(inDpy,~0,result.xkb)!=Success) |