From cba4592846ee2727fb5c5b2a8e839b998e23f1e9 Mon Sep 17 00:00:00 2001 From: Hasan Date: Fri, 7 Aug 2020 20:23:42 -0700 Subject: [PATCH] Send shift modifier for capital latin characters that we need to bind (#283) --- xdo.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xdo.c b/xdo.c index 92e3c87..d54e99c 100644 --- a/xdo.c +++ b/xdo.c @@ -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) {