home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Shareware 1999 March
/
PCShareware-3-99.iso
/
IMPLE
/
DJGPP.RAR
/
DJGPP2
/
XLIB-SR0.ZIP
/
SRC
/
XLIBEMU
/
MAKEMODM.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-30
|
801b
|
37 lines
/* $Id: makemodm.c 1.4 1994/01/30 18:46:18 ulrich Exp $ */
#include <stdio.h>
/* Read an Xmodmap.* and write out C data file */
main()
{
char buffer[200];
int keycode;
char k[4][50];
int row;
int cols;
int i;
row = 8;
while (gets (buffer)) {
if ((cols = sscanf (buffer, "keycode %d%*[ \t]=%s%s%s%s", &keycode,
k[0], k[1], k[2], k[3]) - 1) < 0)
continue;
if (row != keycode)
fprintf (stderr, "row=%d keycode=%d\n", row, keycode);
for (i = 0; i < cols; i++) {
/* if keysym starts with 0x don not prepend XK_ */
if (strncmp ("0x", k[i], 2))
fputs ("XK_", stdout);
fputs (k[i], stdout);
fputs (",\t", stdout);
}
for ( ; i < 4; i++) {
fputs ("NoSymbol,\t", stdout);
}
fputs ("\n", stdout);
row++;
}
}