Mercurial > vim
comparison src/getchar.c @ 19599:5eb0ead1415f v8.2.0356
patch 8.2.0356: MS-Windows: feedkeys() with VIMDLL cannot handle CSI
Commit: https://github.com/vim/vim/commit/8f027fe470555252b258508c455e93700a969cb1
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Mar 4 23:21:35 2020 +0100
patch 8.2.0356: MS-Windows: feedkeys() with VIMDLL cannot handle CSI
Problem: MS-Windows: feedkeys() with VIMDLL cannot handle CSI correctly.
Solution: Modify mch_inchar() to encode CSI bytes. (Ozaki Kiichi, Ken
Takata, closes #5726)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 04 Mar 2020 23:30:04 +0100 |
parents | af9d5585cfbf |
children | 6b1564fcab92 |
comparison
equal
deleted
inserted
replaced
19598:e5054307d4bb | 19599:5eb0ead1415f |
---|---|
1621 } | 1621 } |
1622 | 1622 |
1623 // Get two extra bytes for special keys | 1623 // Get two extra bytes for special keys |
1624 if (c == K_SPECIAL | 1624 if (c == K_SPECIAL |
1625 #ifdef FEAT_GUI | 1625 #ifdef FEAT_GUI |
1626 || (gui.in_use && c == CSI) | 1626 || (c == CSI) |
1627 #endif | 1627 #endif |
1628 ) | 1628 ) |
1629 { | 1629 { |
1630 int save_allow_keys = allow_keys; | 1630 int save_allow_keys = allow_keys; |
1631 | 1631 |
1676 GTK_MENU_SHELL(gui.menubar), FALSE); | 1676 GTK_MENU_SHELL(gui.menubar), FALSE); |
1677 continue; | 1677 continue; |
1678 } | 1678 } |
1679 #endif | 1679 #endif |
1680 #ifdef FEAT_GUI | 1680 #ifdef FEAT_GUI |
1681 if (gui.in_use) | 1681 // Handle focus event here, so that the caller doesn't need to |
1682 // know about it. Return K_IGNORE so that we loop once (needed | |
1683 // if 'lazyredraw' is set). | |
1684 if (c == K_FOCUSGAINED || c == K_FOCUSLOST) | |
1682 { | 1685 { |
1683 // Handle focus event here, so that the caller doesn't | 1686 ui_focus_change(c == K_FOCUSGAINED); |
1684 // need to know about it. Return K_IGNORE so that we loop | 1687 c = K_IGNORE; |
1685 // once (needed if 'lazyredraw' is set). | |
1686 if (c == K_FOCUSGAINED || c == K_FOCUSLOST) | |
1687 { | |
1688 ui_focus_change(c == K_FOCUSGAINED); | |
1689 c = K_IGNORE; | |
1690 } | |
1691 | |
1692 // Translate K_CSI to CSI. The special key is only used | |
1693 // to avoid it being recognized as the start of a special | |
1694 // key. | |
1695 if (c == K_CSI) | |
1696 c = CSI; | |
1697 } | 1688 } |
1689 | |
1690 // Translate K_CSI to CSI. The special key is only used to | |
1691 // avoid it being recognized as the start of a special key. | |
1692 if (c == K_CSI) | |
1693 c = CSI; | |
1698 #endif | 1694 #endif |
1699 } | 1695 } |
1700 // a keypad or special function key was not mapped, use it like | 1696 // a keypad or special function key was not mapped, use it like |
1701 // its ASCII equivalent | 1697 // its ASCII equivalent |
1702 switch (c) | 1698 switch (c) |
1770 for (i = 1; i < n; ++i) | 1766 for (i = 1; i < n; ++i) |
1771 { | 1767 { |
1772 buf[i] = vgetorpeek(TRUE); | 1768 buf[i] = vgetorpeek(TRUE); |
1773 if (buf[i] == K_SPECIAL | 1769 if (buf[i] == K_SPECIAL |
1774 #ifdef FEAT_GUI | 1770 #ifdef FEAT_GUI |
1775 || ( | 1771 || (buf[i] == CSI) |
1776 # ifdef VIMDLL | |
1777 gui.in_use && | |
1778 # endif | |
1779 buf[i] == CSI) | |
1780 #endif | 1772 #endif |
1781 ) | 1773 ) |
1782 { | 1774 { |
1783 // Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER | 1775 // Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER |
1784 // sequence, which represents a K_SPECIAL (0x80), | 1776 // sequence, which represents a K_SPECIAL (0x80), |