DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ T x ┃
Length: 2743 (0xab7) Types: TextFile Names: »xallkeys.c«
└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3 └─ ⟦fc9b38f02⟧ »DATA« └─⟦8e9e227a9⟧ └─⟦0b3b13f5b⟧ └─ ⟦this⟧ »./xallkeys.c« └─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS └─ ⟦91c658230⟧ »DATA« └─⟦5d656759a⟧ └─⟦7d9cab9a9⟧ └─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3 └─ ⟦fc9b38f02⟧ »DATA« └─⟦8e9e227a9⟧ └─⟦7d9cab9a9⟧ └─ ⟦this⟧ »./xallkeys.c« └─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS └─ ⟦91c658230⟧ »DATA« └─⟦5d656759a⟧ └─⟦85ff0a957⟧ └─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3 └─ ⟦fc9b38f02⟧ »DATA« └─⟦8e9e227a9⟧ └─⟦85ff0a957⟧ └─ ⟦this⟧ »./xallkeys.c« └─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3 └─ ⟦fc9b38f02⟧ »DATA« └─⟦8e9e227a9⟧ └─⟦e9895db93⟧ └─ ⟦this⟧ »./xallkeys.c«
/****************************************************************************** * Description * Connect to a display and run through all defined Modifiers and Keysyms * and print the names and numbers to stdout. *****************************************************************************/ #include <X11/Xlib.h> #include <X11/Xatom.h> #include <X11/Xutil.h> #include <stdio.h> #define TRUE 1 #define FALSE 0 char *ProgramName; Display *dpy; static char *help_message[] = { "where options include:", " -display host:dpy X server to use", NULL}; /****************************************************************************** * Description * Main routine. Process command-line arguments, then get the info. *****************************************************************************/ main(argc, argv) int argc; char **argv; { char *display = NULL; /* Process arguments: */ while (*++argv) { if (!strcmp (*argv, "-display")) { display = *++argv; } else { /* unknown arg */ char **cpp; fprintf (stderr, "usage: %s [-options]\n\n", argv[0]); for (cpp = help_message; *cpp; cpp++) { fprintf (stderr, "%s\n", *cpp); } fprintf (stderr, "\n"); exit (1); } } if (!(dpy= XOpenDisplay(display))) { perror("Cannot open display\n"); exit(-1); } { XModifierKeymap *mm = XGetModifierMapping(dpy); KeyCode *map = mm->modifiermap; int i; KeyCode kc; KeySym ks; char *sym; #define mm_loop(modif) \ for (i = 0; i < mm->max_keypermod; i++) { \ kc = *map++; \ if (kc != 0) { \ ks = XKeycodeToKeysym(dpy,kc,0); \ sym = XKeysymToString(ks); \ printf( "Modifier %s %x %s\n", modif, (int)kc, sym ); \ } \ } mm_loop("Shift"); mm_loop("Lock "); mm_loop("Ctrl "); mm_loop("Mod1 "); mm_loop("Mod2 "); mm_loop("Mod3 "); mm_loop("Mod4 "); mm_loop("Mod5 "); XFreeModifiermap(mm); } { KeySym *Mapping; KeySym *ks; int per_keycode; int i; KeyCode kc; char *sym; int first; printf( "Min_KeyCode %x Max_KeyCode %x\n", (int)dpy->min_keycode, (int)dpy->max_keycode ); Mapping = XGetKeyboardMapping( dpy,dpy->min_keycode, dpy->max_keycode - dpy->min_keycode + 1, &per_keycode ); ks = Mapping; for (kc = dpy->min_keycode; kc <= dpy->max_keycode; kc++) { first = TRUE; for (i = 0; i < per_keycode; ks++,i++) { if (*ks != NoSymbol) { sym = XKeysymToString( *ks ); if (first) { first = FALSE; printf( "KeyCode %d 0x%x", (int)kc, (int)kc ); } printf( " %s", sym ); } } if (!first) printf("\n"); } XFree( Mapping ); } XCloseDisplay(dpy); }