mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-03-12 18:32:48 +01:00
Only draw caps-lock upper-case labels for alphabetical keys
Fixes an issue introduced in 9d130e7fd23678de34396ac80dab51f036abb033
This commit is contained in:
parent
9cc8931b46
commit
6041473421
@ -3,6 +3,7 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "drw.h"
|
#include "drw.h"
|
||||||
#include "os-compatibility.h"
|
#include "os-compatibility.h"
|
||||||
@ -537,7 +538,8 @@ kbd_print_key_stdout(struct kbd *kb, struct key *k)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!handled) {
|
if (!handled) {
|
||||||
if ((kb->mods & Shift) || (kb->mods & CapsLock))
|
if ((kb->mods & Shift) ||
|
||||||
|
((kb->mods & CapsLock) & (strlen(k->label) == 1 && isalpha(k->label[0]))))
|
||||||
printf("%s", k->shift_label);
|
printf("%s", k->shift_label);
|
||||||
else if (!(kb->mods & Ctrl) && !(kb->mods & Alt) && !(kb->mods & Super))
|
else if (!(kb->mods & Ctrl) && !(kb->mods & Alt) && !(kb->mods & Super))
|
||||||
printf("%s", k->label);
|
printf("%s", k->label);
|
||||||
@ -561,7 +563,8 @@ kbd_clear_last_popup(struct kbd *kb)
|
|||||||
void
|
void
|
||||||
kbd_draw_key(struct kbd *kb, struct key *k, enum key_draw_type type)
|
kbd_draw_key(struct kbd *kb, struct key *k, enum key_draw_type type)
|
||||||
{
|
{
|
||||||
const char *label = ((kb->mods & Shift)||(kb->mods & CapsLock)) ? k->shift_label : k->label;
|
const char *label = ((kb->mods & Shift)||((kb->mods & CapsLock) &&
|
||||||
|
strlen(k->label) == 1 && isalpha(k->label[0]))) ? k->shift_label : k->label;
|
||||||
if (kb->debug)
|
if (kb->debug)
|
||||||
fprintf(stderr, "Draw key +%d+%d %dx%d -> %s\n", k->x, k->y, k->w, k->h,
|
fprintf(stderr, "Draw key +%d+%d %dx%d -> %s\n", k->x, k->y, k->w, k->h,
|
||||||
label);
|
label);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user