class Test : Object { public static void main(){ int min_keycodes_return = 0; int max_keycodes_return = 0; int keysyms_per_keycode_return = 0; X.Display display = new X.Display(); stdout.printf("On this system sizeof(char) is %lu bytes, sizeof(int) is %lu bytes and sizeof(long) is %lu bytes.\n", sizeof(char), sizeof(int), sizeof(long)); display.keycodes(ref min_keycodes_return, ref max_keycodes_return); int keycode_count = max_keycodes_return - min_keycodes_return + 1; stdout.printf("The minimal keycode is %d, the maximal keycode is %d which makes a total of %d keycodes.\n", min_keycodes_return, max_keycodes_return, keycode_count); ulong* mapping = display.get_keyboard_mapping((uchar) min_keycodes_return, keycode_count, ref keysyms_per_keycode_return); stdout.printf("With this keyboard mapping there are %d keysyms per keycode, detailed mapping follows:\n", keysyms_per_keycode_return); for(int i = 0; i < keycode_count; i++){ stdout.printf(" KeyCode %3d has KeySyms: ", i); for(int j = 0; j < keysyms_per_keycode_return; j++){ stdout.printf("%8lXh ", mapping[i * keysyms_per_keycode_return + j]); } stdout.printf("\n"); } } }