File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1623,13 +1623,14 @@ updatescript(int c)
16231623
16241624/*
16251625 * Convert "c" plus "modifiers" to merge the effect of modifyOtherKeys into the
1626- * character.
1626+ * character. Also for when the Kitty key protocol is used.
16271627 */
16281628 int
16291629merge_modifyOtherKeys (int c_arg , int * modifiers )
16301630{
16311631 int c = c_arg ;
16321632
1633+ // CTRL only uses the lower 5 bits of the character.
16331634 if (* modifiers & MOD_MASK_CTRL )
16341635 {
16351636 if ((c >= '`' && c <= 0x7f ) || (c >= '@' && c <= '_' ))
@@ -1658,12 +1659,23 @@ merge_modifyOtherKeys(int c_arg, int *modifiers)
16581659 if (c != c_arg )
16591660 * modifiers &= ~MOD_MASK_CTRL ;
16601661 }
1662+
1663+ // Alt/Meta sets the 8th bit of the character.
16611664 if ((* modifiers & (MOD_MASK_META | MOD_MASK_ALT ))
16621665 && c >= 0 && c <= 127 )
16631666 {
1667+ // Some terminals (esp. Kitty) do not include Shift in the character.
1668+ // Apply it here to get consistency across terminals. Only do ASCII
1669+ // letters, for other characters it depends on the keyboard layout.
1670+ if ((* modifiers & MOD_MASK_SHIFT ) && c >= 'a' && c <= 'z' )
1671+ {
1672+ c += 'a' - 'A' ;
1673+ * modifiers &= ~MOD_MASK_SHIFT ;
1674+ }
16641675 c += 0x80 ;
16651676 * modifiers &= ~(MOD_MASK_META | MOD_MASK_ALT );
16661677 }
1678+
16671679 return c ;
16681680}
16691681
Original file line number Diff line number Diff line change @@ -695,6 +695,8 @@ static char *(features[]) =
695695
696696static int included_patches [] =
697697{ /* Add new patch number below this line */
698+ /**/
699+ 1414 ,
698700/**/
699701 1413 ,
700702/**/
You can’t perform that action at this time.
0 commit comments