Skip to content

Commit

Permalink
Send shift modifier for capital latin characters that we need to bind (
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanPotato authored Aug 8, 2020
1 parent d969274 commit cba4592
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions xdo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,14 @@ static KeySym _xdo_keysym_from_char(const xdo_t *xdo, wchar_t key) {
static void _xdo_charcodemap_from_char(const xdo_t *xdo, charcodemap_t *key) {
KeySym keysym = _xdo_keysym_from_char(xdo, key->key);
_xdo_charcodemap_from_keysym(xdo, key, keysym);

/* If the character is an uppercase character within the Basic Latin or Latin-1 code block,
* then sending the capital character keycode will not work.
* We have to also send the shift modifier.
* There are only three ranges of capital letters to worry about */
if ((key->key >= 0x41 && key->key <= 0x5A) || (key->key >= 0xC0 && key->key <= 0xD6) || (key->key >= 0xD8 && key->key <= 0xDE)) {
key->modmask = ShiftMask;
}
}

static void _xdo_charcodemap_from_keysym(const xdo_t *xdo, charcodemap_t *key, KeySym keysym) {
Expand Down

0 comments on commit cba4592

Please sign in to comment.