Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send shift modifier for capital latin characters that we need to bind #283

Merged
merged 1 commit into from
Aug 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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