8 Commits
v0.3 ... v0.6

Author SHA1 Message Date
bddf05e0fc key drawing: refactor kbd_draw_key 2022-01-10 03:08:06 +00:00
564eb4536a overlapped key output: highlight letters swiped through 2022-01-10 03:08:06 +00:00
2de12a90e4 output: add -O flag to output overlapped keys
the use-case for this is simple 'swipe'-typing:
another program can take the output, guess the word which is being typed, and type the rest of the word
2022-01-10 03:08:06 +00:00
c541c7dbd6 add Georgian layout 2022-01-08 07:53:34 +00:00
780a83dba5 Fixed erroneous glyphcodes for turkish dotless i and turkish capital I with dot 2022-01-08 07:48:49 +00:00
6abc005124 added missing abc/sym key to dialer layer 2021-12-01 10:01:43 -08:00
35c5f44e3c change config.def.h to include dialer 2021-11-16 11:04:21 -08:00
4bf9d53a00 Add a dialer layout
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-11-16 10:23:29 -08:00
9 changed files with 1704 additions and 34 deletions

View File

@ -66,7 +66,12 @@ Wvkbd has an output mode `-o` that will echo its output to standard output. This
audio/haptic feedback, a feature explicitly out of scope for wvkbd. To achieve this, simply pipe wvkbd's output through the external tool
[clickclack](https://git.sr.ht/~proycon/clickclack):
`$ wvkbd-mobileintl -l simple,special,emoji -o | clickclack -V -f keypress.wav`
`$ wvkbd-mobintl -l simple,special,emoji -o | clickclack -V -f keypress.wav`
Another output mode, `-O` will let the keyboard output keys which are swiped over. It can be used by an external program, such as [swipeGuess](https://git.sr.ht/~earboxer/swipeGuess) to get swipe-typing support.
`$ wvkbd-mobintl -O | swipeGuess.sh words.txt | completelyTypeWord.sh`
## Contribute
@ -80,6 +85,7 @@ possible.
## Related projects
* [clickclack](https://git.sr.ht/~proycon/clickclack) - Audio/haptic feedback (standalone)
* [swipeGuess](https://git.sr.ht/~earboxer/swipeGuess) - Word-completion for swipe-typing
* [Sxmo](https://sxmo.org) - A hackable mobile interface environment for Linux phones that adopted wvkbd as its keyboard
* [svkbd](https://tools.suckless.org/x/svkbd/) - A similar project as wvkbd but for X11 rather than Wayland
* [squeekboard](https://gitlab.gnome.org/World/Phosh/squeekboard) - The virtual keyboard developed for the Librem5 (used

View File

@ -8,6 +8,7 @@ struct clr_scheme scheme = {
.bg = {.bgra = {15, 15, 15, 225}},
.fg = {.bgra = {45, 45, 45, 225}},
.high = {.bgra = {100, 100, 100, 225}},
.swipe = {.bgra = {100, 255, 100, 64}},
.text = {.color = UINT32_MAX},
};
struct clr_scheme scheme1 = {
@ -15,13 +16,14 @@ struct clr_scheme scheme1 = {
.bg = {.bgra = {15, 15, 15, 225}},
.fg = {.bgra = {32, 32, 32, 225}},
.high = {.bgra = {100, 100, 100, 225}},
.swipe = {.bgra = {100, 255, 100, 64}},
.text = {.color = UINT32_MAX},
};
/* layers is an ordered list of layouts, used to cycle through */
static enum layout_id layers[] = {
Full, // First layout is the default layout on startup
Special, Emoji, Simple, SimpleGrid, Nav, Cyrillic, Arabic,
Special, Emoji, Simple, SimpleGrid, Nav, Dialer, Cyrillic, Arabic, Georgian,
NumLayouts // signals the last item, may not be omitted
};

23
drw.c
View File

@ -69,11 +69,15 @@ drw_draw_text(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
}
void
drw_fill_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h) {
drw_do_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h, bool over) {
cairo_save(d->cairo);
cairo_set_operator(d->cairo, CAIRO_OPERATOR_SOURCE);
if (over) {
cairo_set_operator(d->cairo, CAIRO_OPERATOR_OVER);
} else {
cairo_set_operator(d->cairo, CAIRO_OPERATOR_SOURCE);
}
cairo_rectangle(d->cairo, x, y, w, h);
cairo_set_source_rgba(
@ -81,11 +85,24 @@ drw_fill_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
color.bgra[0] / (double)255, color.bgra[3] / (double)255);
cairo_fill(d->cairo);
cairo_restore(d->cairo);
wl_surface_damage(d->surf, x, y, w, h);
}
void
drw_fill_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h) {
drw_do_rectangle(d, color, x, y, w, h, false);
}
void
drw_over_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h) {
drw_do_rectangle(d, color, x, y, w, h, true);
}
uint32_t
setup_buffer(struct drwsurf *drwsurf) {
int stride = drwsurf->width * 4;

4
drw.h
View File

@ -31,8 +31,12 @@ typedef union {
uint32_t color;
} Color;
void drw_do_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h, bool fill);
void drw_fill_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h);
void drw_over_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h);
void drw_draw_text(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h, const char *label);

View File

@ -167,7 +167,7 @@ kbd_get_key(struct kbd *kb, uint32_t x, uint32_t y) {
void
kbd_unpress_key(struct kbd *kb, uint32_t time) {
if (kb->last_press) {
kbd_draw_key(kb, kb->last_press, false);
kbd_draw_key(kb, kb->last_press, Unpress);
if (kb->last_press->type == Copy) {
zwp_virtual_keyboard_v1_key(kb->vkbd, time, 127, // COMP key
WL_KEYBOARD_KEY_STATE_RELEASED);
@ -189,6 +189,39 @@ kbd_unpress_key(struct kbd *kb, uint32_t time) {
}
}
void kbd_release_key(struct kbd *kb, uint32_t time) {
kbd_unpress_key(kb, time);
if (kb->print_intersect && kb->last_swipe) {
printf("\n");
// Important so autocompleted words get typed in time
fflush(stdout);
kbd_draw_layout(kb);
kb->last_swipe = NULL;
}
}
void kbd_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y) {
// Output intersecting keys
// (for external 'swiping'-based accelerators).
if (kb->print_intersect) {
if (kb->last_press) {
kbd_unpress_key(kb, time);
// Redraw last press as a swipe.
kbd_draw_key(kb, kb->last_swipe, Swipe);
}
struct key *intersect_key;
intersect_key = kbd_get_key(kb, x, y);
if (intersect_key &&
(! kb->last_swipe || intersect_key->label != kb->last_swipe->label)) {
kbd_print_key_stdout(kb, intersect_key);
kb->last_swipe = intersect_key;
kbd_draw_key(kb, kb->last_swipe, Swipe);
}
} else {
kbd_unpress_key(kb, time);
}
}
void
kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
if ((kb->compose == 1) && (k->type != Compose) && (k->type != Mod) &&
@ -212,11 +245,11 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
} else {
zwp_virtual_keyboard_v1_modifiers(kb->vkbd, kb->mods, 0, 0, 0);
}
kb->last_press = k;
kbd_draw_key(kb, k, true);
kb->last_swipe = kb->last_press = k;
kbd_draw_key(kb, k, Press);
zwp_virtual_keyboard_v1_key(kb->vkbd, time, kb->last_press->code,
WL_KEYBOARD_KEY_STATE_PRESSED);
if (kb->print)
if (kb->print || kb->print_intersect)
kbd_print_key_stdout(kb, k);
if (kb->compose) {
if (kb->debug)
@ -229,7 +262,11 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
if (k->code == Shift) {
kbd_draw_layout(kb);
}
kbd_draw_key(kb, k, kb->mods & k->code);
if (kb->mods & k->code) {
kbd_draw_key(kb, k, Press);
} else {
kbd_draw_key(kb, k, Unpress);
}
zwp_virtual_keyboard_v1_modifiers(kb->vkbd, kb->mods, 0, 0, 0);
break;
case Layout:
@ -243,7 +280,11 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
} else {
kb->compose = 0;
}
kbd_draw_key(kb, k, (bool)kb->compose);
if ((bool)kb->compose) {
kbd_draw_key(kb, k, Press);
} else {
kbd_draw_key(kb, k, Unpress);
}
break;
case NextLayer:
// switch to the next layout in the layer sequence
@ -271,15 +312,15 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
break;
case Copy:
// copy code as unicode chr by setting a temporary keymap
kb->last_press = k;
kbd_draw_key(kb, k, true);
kb->last_swipe = kb->last_press = k;
kbd_draw_key(kb, k, Press);
if (kb->debug)
fprintf(stderr, "pressing copy key\n");
create_and_upload_keymap(kb, kb->layout->keymap_name, k->code, k->code_mod);
zwp_virtual_keyboard_v1_modifiers(kb->vkbd, kb->mods, 0, 0, 0);
zwp_virtual_keyboard_v1_key(kb->vkbd, time, 127, // COMP key
WL_KEYBOARD_KEY_STATE_PRESSED);
if (kb->print)
if (kb->print || kb->print_intersect)
kbd_print_key_stdout(kb, k);
break;
default:
@ -327,15 +368,24 @@ kbd_print_key_stdout(struct kbd *kb, struct key *k) {
}
void
kbd_draw_key(struct kbd *kb, struct key *k, bool pressed) {
kbd_draw_key(struct kbd *kb, struct key *k, enum key_draw_type type) {
struct drwsurf *d = kb->surf;
const char *label = (kb->mods & Shift) ? k->shift_label : k->label;
if (kb->debug)
fprintf(stderr, "Draw key +%d+%d %dx%d -> %s\n", k->x, k->y, k->w, k->h,
label);
struct clr_scheme *scheme = (k->scheme == 0) ? &(kb->scheme) : &(kb->scheme1);
Color *fill = pressed ? &scheme->high : &scheme->fg;
draw_inset(d, k->x, k->y, k->w, k->h, KBD_KEY_BORDER, *fill);
switch (type) {
case Unpress:
draw_inset(d, k->x, k->y, k->w, k->h, KBD_KEY_BORDER, scheme->fg);
break;
case Press:
draw_inset(d, k->x, k->y, k->w, k->h, KBD_KEY_BORDER, scheme->high);
break;
case Swipe:
draw_over_inset(d, k->x, k->y, k->w, k->h, KBD_KEY_BORDER, scheme->swipe);
break;
}
drw_draw_text(d, scheme->text, k->x, k->y, k->w, k->h, label);
}
@ -343,7 +393,6 @@ void
kbd_draw_layout(struct kbd *kb) {
struct drwsurf *d = kb->surf;
struct key *next_key = kb->layout->keys;
bool pressed = false;
if (kb->debug)
fprintf(stderr, "Draw layout");
@ -354,8 +403,11 @@ kbd_draw_layout(struct kbd *kb) {
next_key++;
continue;
}
pressed = next_key->type == Mod && kb->mods & next_key->code;
kbd_draw_key(kb, next_key, pressed);
if (next_key->type == Mod && kb->mods & next_key->code) {
kbd_draw_key(kb, next_key, Press);
} else {
kbd_draw_key(kb, next_key, Unpress);
}
next_key++;
}
}
@ -380,6 +432,12 @@ draw_inset(struct drwsurf *ds, uint32_t x, uint32_t y, uint32_t width,
drw_fill_rectangle(ds, color, x + border, y + border, width - border,
height - border);
}
void
draw_over_inset(struct drwsurf *ds, uint32_t x, uint32_t y, uint32_t width,
uint32_t height, uint32_t border, Color color) {
drw_over_rectangle(ds, color, x + border, y + border, width - border,
height - border);
}
void
create_and_upload_keymap(struct kbd *kb, const char *name, uint32_t comp_unichr,

View File

@ -41,10 +41,17 @@ enum key_modifier_type {
AltGr = 128,
};
enum key_draw_type {
Unpress = 0,
Press,
Swipe,
};
struct clr_scheme {
Color fg;
Color bg;
Color high;
Color swipe;
Color text;
};
@ -85,11 +92,13 @@ struct kbd {
struct clr_scheme scheme1;
bool print;
bool print_intersect;
uint32_t w, h, s;
bool landscape;
uint8_t mods;
uint8_t compose;
struct key *last_press;
struct key *last_swipe;
struct layout *prevlayout;
size_t layer_index;
@ -103,14 +112,18 @@ struct kbd {
void draw_inset(struct drwsurf *ds, uint32_t x, uint32_t y, uint32_t width,
uint32_t height, uint32_t border, Color color);
void draw_over_inset(struct drwsurf *ds, uint32_t x, uint32_t y, uint32_t width,
uint32_t height, uint32_t border, Color color);
void kbd_init(struct kbd *kb, struct layout *layouts, char *layer_names_list);
void kbd_init_layout(struct layout *l, uint32_t width, uint32_t height);
struct key *kbd_get_key(struct kbd *kb, uint32_t x, uint32_t y);
void kbd_unpress_key(struct kbd *kb, uint32_t time);
void kbd_release_key(struct kbd *kb, uint32_t time);
void kbd_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y);
void kbd_press_key(struct kbd *kb, struct key *k, uint32_t time);
void kbd_print_key_stdout(struct kbd *kb, struct key *k);
void kbd_draw_key(struct kbd *kb, struct key *k, bool pressed);
void kbd_draw_key(struct kbd *kb, struct key *k, enum key_draw_type);
void kbd_draw_layout(struct kbd *kb);
void kbd_resize(struct kbd *kb, struct layout *layouts, uint8_t layoutcount);
uint8_t kbd_get_rows(struct layout *l);

File diff suppressed because it is too large Load Diff

View File

@ -18,8 +18,10 @@ enum layout_id {
Special,
Simple,
SimpleGrid,
Dialer,
Cyrillic,
Arabic,
Georgian,
Emoji,
Nav,
Landscape,
@ -65,7 +67,7 @@ enum layout_id {
};
static struct key keys_full[], keys_special[], keys_simple[], keys_simplegrid[],
keys_cyrillic[], keys_arabic[], keys_emoji[], keys_nav[], keys_landscape[],
keys_cyrillic[], keys_arabic[], keys_georgian[], keys_emoji[], keys_nav[], keys_landscape[],
keys_compose_a[], keys_compose_e[], keys_compose_y[], keys_compose_u[],
keys_compose_i[], keys_compose_o[], keys_compose_w[], keys_compose_r[],
keys_compose_t[], keys_compose_p[], keys_compose_s[], keys_compose_d[],
@ -76,7 +78,7 @@ static struct key keys_full[], keys_special[], keys_simple[], keys_simplegrid[],
keys_compose_bracket[], keys_compose_cyr_i[], keys_compose_cyr_j[],
keys_compose_cyr_e[], keys_compose_cyr_u[], keys_compose_cyr_l[],
keys_compose_cyr_n[], keys_compose_cyr_tse[], keys_compose_cyr_che[],
keys_compose_cyr_g[], keys_compose_cyr_k[];
keys_compose_cyr_g[], keys_compose_cyr_k[], keys_dialer[];
static struct layout layouts[NumLayouts] = {
[Full] = {keys_full, "latin", "full"}, // second parameter is the keymap name
@ -85,7 +87,9 @@ static struct layout layouts[NumLayouts] = {
[Simple] = {keys_simple, "latin", "simple"},
[SimpleGrid] = {keys_simplegrid, "latin", "simplegrid"},
[Cyrillic] = {keys_cyrillic, "cyrillic", "cyrillic"},
[Dialer] = {keys_dialer, "latin", "dialer"},
[Arabic] = {keys_arabic, "arabic", "arabic"},
[Georgian] = {keys_georgian, "georgian", "georgian"},
[Emoji] = {keys_emoji, "latin", "emoji"},
[Nav] = {keys_nav, "latin", "nav"},
[Landscape] = {keys_landscape, "latin", "landscape"},
@ -341,6 +345,33 @@ static struct key keys_simple[] = {
{"", "", 0.0, Last},
};
static struct key keys_dialer[] = {
{"Esc", "Esc", 1.0, Code, KEY_ESC, .scheme = 1},
{"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow},
{"1", "1", 1.0, Code, KEY_1},
{"2", "2", 1.0, Code, KEY_2},
{"3", "3", 1.0, Code, KEY_3},
{"", "", 0.0, EndRow},
{"4", "4", 1.0, Code, KEY_4},
{"5", "5", 1.0, Code, KEY_5},
{"6", "6", 1.0, Code, KEY_6},
{"", "", 0.0, EndRow},
{"7", "7", 1.0, Code, KEY_7},
{"8", "8", 1.0, Code, KEY_8},
{"9", "9", 1.0, Code, KEY_9},
{"", "", 0.0, EndRow},
{"*", "*", 1.0, Code, KEY_KPASTERISK},
{"0", "0", 1.0, Code, KEY_0},
{"#", "#", 1.0, Code, KEY_NUMERIC_POUND},
{"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1},
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
/* end of layout */
{"", "", 0.0, Last},
};
static struct key keys_simplegrid[] = {
{"q", "Q", 1.0, Code, KEY_Q, &layouts[Emoji]},
{"w", "W", 1.0, Code, KEY_W, &layouts[ComposeW]},
@ -519,6 +550,66 @@ static struct key keys_arabic[] = {
{"", "", 0.0, Last},
};
static struct key keys_georgian[] = {
{"1", "!", 1.0, Code, KEY_1},
{"2", "@", 1.0, Code, KEY_2},
{"3", "#", 1.0, Code, KEY_3},
{"4", ";", 1.0, Code, KEY_4},
{"5", "%", 1.0, Code, KEY_5},
{"6", ":", 1.0, Code, KEY_6},
{"7", "&", 1.0, Code, KEY_7},
{"8", "*", 1.0, Code, KEY_8},
{"9", "(", 1.0, Code, KEY_9},
{"0", ")", 1.0, Code, KEY_0},
{"", "", 0.0, EndRow},
{"", "Q", 1.0, Code, KEY_Q},
{"", "", 1.0, Code, KEY_W},
{"", "E", 1.0, Code, KEY_E},
{"", "", 1.0, Code, KEY_R},
{"", "", 1.0, Code, KEY_T},
{"", "Y", 1.0, Code, KEY_Y},
{"", "U", 1.0, Code, KEY_U},
{"", "I", 1.0, Code, KEY_I},
{"", "O", 1.0, Code, KEY_O},
{"", "P", 1.0, Code, KEY_P},
{"", "", 0.0, EndRow},
{"", "A", 1.0, Code, KEY_A},
{"", "", 1.0, Code, KEY_S},
{"", "D", 1.0, Code, KEY_D},
{"", "F", 1.0, Code, KEY_F},
{"", "G", 1.0, Code, KEY_G},
{"", "H", 1.0, Code, KEY_H},
{"", "", 1.0, Code, KEY_J},
{"", "K", 1.0, Code, KEY_K},
{"", "L", 1.0, Code, KEY_L},
{";", ":", 1.0, Code, KEY_SEMICOLON},
{"", "", 0.0, EndRow},
{"", "", 1.0, Code, KEY_Z},
{"", "X", 1.0, Code, KEY_X},
{"", "", 1.0, Code, KEY_C},
{"", "V", 1.0, Code, KEY_V},
{"", "B", 1.0, Code, KEY_B},
{"", "N", 1.0, Code, KEY_N},
{"", "M", 1.0, Code, KEY_M},
{",", "<", 1.0, Code, KEY_COMMA},
{".", ">", 1.0, Code, KEY_DOT},
{"", "", 1.0, Code, KEY_BACKSPACE, .scheme = 1},
{"", "", 0.0, EndRow},
{"Abc", "Abc", 1.0, NextLayer, .scheme = 1},
{"", "", 1.0, Mod, Shift, .scheme = 1},
{"Cmp", "Cmp", 1.0, Compose, .scheme = 1},
{"", "", 5.0, Code, KEY_SPACE},
{"Enter", "Enter", 2.0, Code, KEY_ENTER, .scheme = 1},
/* end of layout */
{"", "", 0.0, Last},
};
static struct key keys_compose_a[] = {
{"à", "À", 1.0, Copy, 0x00E0, 0, 0x00C0},
{"á", "Á", 1.0, Copy, 0x00E1, 0, 0x00C1},
@ -662,8 +753,8 @@ static struct key keys_compose_i[] = {
{"ī", "Ī", 1.0, Copy, 0x012B, 0, 0x012A},
{"ĭ", "Ĭ", 1.0, Copy, 0x012D, 0, 0x012C},
{"į", "Į", 1.0, Copy, 0x012F, 0, 0x012E},
{"ı", "I", 1.0, Copy, 0x0150, 0, 0x0049},
{"i", "İ", 1.0, Copy, 0x0069, 0, 0x0152},
{"ı", "I", 1.0, Copy, 0x0131, 0, 0x0049},
{"i", "İ", 1.0, Copy, 0x0069, 0, 0x0130},
{"", "", 0.0, EndRow},
{"ι", "Ι", 1.0, Copy, 0x03B9, 0, 0x0399},
{"η", "Η", 1.0, Copy, 0x03B7, 0, 0x0397},

29
main.c
View File

@ -42,6 +42,7 @@ static uint32_t anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
/* application state */
static bool run_display = true;
static int cur_x = -1, cur_y = -1;
static bool cur_press = false;
static struct kbd keyboard;
static uint32_t height, normal_height, landscape_height;
@ -159,13 +160,18 @@ wl_touch_down(void *data, struct wl_touch *wl_touch, uint32_t serial,
void
wl_touch_up(void *data, struct wl_touch *wl_touch, uint32_t serial,
uint32_t time, int32_t id) {
kbd_unpress_key(&keyboard, time);
kbd_release_key(&keyboard, time);
}
void
wl_touch_motion(void *data, struct wl_touch *wl_touch, uint32_t time,
int32_t id, wl_fixed_t x, wl_fixed_t y) {
kbd_unpress_key(&keyboard, time);
uint32_t touch_x, touch_y;
touch_x = wl_fixed_to_int(x);
touch_y = wl_fixed_to_int(y);
kbd_motion_key(&keyboard, time, touch_x, touch_y);
}
void
@ -199,18 +205,24 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer, uint32_t time,
cur_x = wl_fixed_to_int(surface_x);
cur_y = wl_fixed_to_int(surface_y);
kbd_unpress_key(&keyboard, time);
if (cur_press) {
kbd_motion_key(&keyboard, time, cur_x, cur_y);
}
}
void
wl_pointer_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial,
uint32_t time, uint32_t button, uint32_t state) {
struct key *next_key;
bool press = state == WL_POINTER_BUTTON_STATE_PRESSED;
cur_press = state == WL_POINTER_BUTTON_STATE_PRESSED;
kbd_unpress_key(&keyboard, time);
if (cur_press) {
kbd_unpress_key(&keyboard, time);
} else {
kbd_release_key(&keyboard, time);
}
if (press && cur_x >= 0 && cur_y >= 0) {
if (cur_press && cur_x >= 0 && cur_y >= 0) {
next_key = kbd_get_key(&keyboard, cur_x, cur_y);
if (next_key) {
kbd_press_key(&keyboard, next_key, time);
@ -335,7 +347,8 @@ usage(char *argv0) {
argv0);
fprintf(stderr, "Options:\n");
fprintf(stderr, " -D - Enable debug\n");
fprintf(stderr, " -o - Print press keys to standard output\n");
fprintf(stderr, " -o - Print pressed keys to standard output\n");
fprintf(stderr, " -O - Print intersected keys to standard output\n");
fprintf(stderr, " -l - Comma separated list of layers\n");
fprintf(stderr, " -H [int] - Height in pixels\n");
fprintf(stderr, " -L [int] - Landscape height in pixels\n");
@ -445,6 +458,8 @@ main(int argc, char **argv) {
fc_font_pattern = estrdup(argv[++i]);
} else if (!strcmp(argv[i], "-o")) {
keyboard.print = true;
} else if (!strcmp(argv[i], "-O")) {
keyboard.print_intersect = true;
} else if ((!strcmp(argv[i], "-hidden")) || (!strcmp(argv[i], "--hidden"))) {
starthidden = true;
} else {