Skip to content

Commit 0adae2d

Browse files
yegappanbrammool
authored andcommitted
patch 9.0.0429: not all keys are tested for the MS-Windows GUI
Problem: Not all keys are tested for the MS-Windows GUI. Solution: Add more key codes to the list. (Yegappan Lakshmanan, closes #11097)
1 parent be9fc5b commit 0adae2d

File tree

2 files changed

+80
-50
lines changed

2 files changed

+80
-50
lines changed

src/testdir/test_gui.vim

Lines changed: 78 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,63 +1651,91 @@ func Test_gui_lowlevel_keyevent()
16511651
endfor
16521652

16531653
" Test for the various Ctrl and Shift key combinations.
1654+
" Refer to the following page for the virtual key codes:
1655+
" https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
16541656
let keytests = [
1655-
\ [[0x10, 0x21], "\<S-Pageup>", 2],
1656-
\ [[0x11, 0x21], "\<C-Pageup>", 4],
1657-
\ [[0x10, 0x22], "\<S-PageDown>", 2],
1658-
\ [[0x11, 0x22], "\<C-PageDown>", 4],
1659-
\ [[0x10, 0x23], "\<S-End>", 0],
1660-
\ [[0x11, 0x23], "\<C-End>", 0],
1661-
\ [[0x10, 0x24], "\<S-Home>", 0],
1662-
\ [[0x11, 0x24], "\<C-Home>", 0],
1663-
\ [[0x10, 0x25], "\<S-Left>", 0],
1664-
\ [[0x11, 0x25], "\<C-Left>", 0],
1665-
\ [[0x10, 0x26], "\<S-Up>", 0],
1666-
\ [[0x11, 0x26], "\<C-Up>", 4],
1667-
\ [[0x10, 0x27], "\<S-Right>", 0],
1668-
\ [[0x11, 0x27], "\<C-Right>", 0],
1669-
\ [[0x10, 0x28], "\<S-Down>", 0],
1670-
\ [[0x11, 0x28], "\<C-Down>", 4],
1671-
\ [[0x11, 0x30], "\<C-0>", 4],
1672-
\ [[0x11, 0x31], "\<C-1>", 4],
1673-
\ [[0x11, 0x32], "\<C-2>", 4],
1674-
\ [[0x11, 0x33], "\<C-3>", 4],
1675-
\ [[0x11, 0x34], "\<C-4>", 4],
1676-
\ [[0x11, 0x35], "\<C-5>", 4],
1677-
\ [[0x11, 0x36], "\<C-^>", 0],
1678-
\ [[0x11, 0x37], "\<C-7>", 4],
1679-
\ [[0x11, 0x38], "\<C-8>", 4],
1680-
\ [[0x11, 0x39], "\<C-9>", 4],
1681-
\ [[0x11, 0x60], "\<C-0>", 4],
1682-
\ [[0x11, 0x61], "\<C-1>", 4],
1683-
\ [[0x11, 0x62], "\<C-2>", 4],
1684-
\ [[0x11, 0x63], "\<C-3>", 4],
1685-
\ [[0x11, 0x64], "\<C-4>", 4],
1686-
\ [[0x11, 0x65], "\<C-5>", 4],
1687-
\ [[0x11, 0x66], "\<C-6>", 4],
1688-
\ [[0x11, 0x67], "\<C-7>", 4],
1689-
\ [[0x11, 0x68], "\<C-8>", 4],
1690-
\ [[0x11, 0x69], "\<C-9>", 4],
1691-
\ [[0x11, 0x6A], "\<C-*>", 4],
1692-
\ [[0x11, 0x6B], "\<C-+>", 4],
1693-
\ [[0x11, 0x6D], "\<C-->", 4],
1694-
\ [[0x11, 0x70], "\<C-F1>", 4],
1695-
\ [[0x11, 0x71], "\<C-F2>", 4],
1696-
\ [[0x11, 0x72], "\<C-F3>", 4],
1697-
\ [[0x11, 0x73], "\<C-F4>", 4],
1698-
\ [[0x11, 0x74], "\<C-F5>", 4],
1699-
\ [[0x11, 0x75], "\<C-F6>", 4],
1700-
\ [[0x11, 0x76], "\<C-F7>", 4],
1701-
\ [[0x11, 0x77], "\<C-F8>", 4],
1702-
\ [[0x11, 0x78], "\<C-F9>", 4],
1657+
\ [[0x10, 0x21], "S-Pageup", 2],
1658+
\ [[0xA0, 0x21], "S-Pageup", 2],
1659+
\ [[0xA1, 0x21], "S-Pageup", 2],
1660+
\ [[0x11, 0x21], "C-Pageup", 4],
1661+
\ [[0xA2, 0x21], "C-Pageup", 4],
1662+
\ [[0xA3, 0x21], "C-Pageup", 4],
1663+
\ [[0x11, 0x10, 0x21], "C-S-Pageup", 6],
1664+
\ [[0x10, 0x22], "S-PageDown", 2],
1665+
\ [[0xA0, 0x22], "S-PageDown", 2],
1666+
\ [[0xA1, 0x22], "S-PageDown", 2],
1667+
\ [[0x11, 0x22], "C-PageDown", 4],
1668+
\ [[0xA2, 0x22], "C-PageDown", 4],
1669+
\ [[0xA3, 0x22], "C-PageDown", 4],
1670+
\ [[0x11, 0x10, 0x22], "C-S-PageDown", 6],
1671+
\ [[0x10, 0x23], "S-End", 0],
1672+
\ [[0x11, 0x23], "C-End", 0],
1673+
\ [[0x11, 0x10, 0x23], "C-S-End", 4],
1674+
\ [[0x10, 0x24], "S-Home", 0],
1675+
\ [[0x11, 0x24], "C-Home", 0],
1676+
\ [[0x11, 0x10, 0x24], "C-S-Home", 4],
1677+
\ [[0x10, 0x25], "S-Left", 0],
1678+
\ [[0x11, 0x25], "C-Left", 0],
1679+
\ [[0x11, 0x10, 0x25], "C-S-Left", 4],
1680+
\ [[0x10, 0x26], "S-Up", 0],
1681+
\ [[0x11, 0x26], "C-Up", 4],
1682+
\ [[0x11, 0x10, 0x26], "C-S-Up", 4],
1683+
\ [[0x10, 0x27], "S-Right", 0],
1684+
\ [[0x11, 0x27], "C-Right", 0],
1685+
\ [[0x11, 0x10, 0x27], "C-S-Right", 4],
1686+
\ [[0x10, 0x28], "S-Down", 0],
1687+
\ [[0x11, 0x28], "C-Down", 4],
1688+
\ [[0x11, 0x10, 0x28], "C-S-Down", 4],
1689+
\ [[0x11, 0x30], "C-0", 4],
1690+
\ [[0x11, 0x31], "C-1", 4],
1691+
\ [[0x11, 0x32], "C-2", 4],
1692+
\ [[0x11, 0x33], "C-3", 4],
1693+
\ [[0x11, 0x34], "C-4", 4],
1694+
\ [[0x11, 0x35], "C-5", 4],
1695+
\ [[0x11, 0x36], "C-^", 0],
1696+
\ [[0x11, 0x37], "C-7", 4],
1697+
\ [[0x11, 0x38], "C-8", 4],
1698+
\ [[0x11, 0x39], "C-9", 4],
1699+
\ [[0x11, 0x60], "C-0", 4],
1700+
\ [[0x11, 0x61], "C-1", 4],
1701+
\ [[0x11, 0x62], "C-2", 4],
1702+
\ [[0x11, 0x63], "C-3", 4],
1703+
\ [[0x11, 0x64], "C-4", 4],
1704+
\ [[0x11, 0x65], "C-5", 4],
1705+
\ [[0x11, 0x66], "C-6", 4],
1706+
\ [[0x11, 0x67], "C-7", 4],
1707+
\ [[0x11, 0x68], "C-8", 4],
1708+
\ [[0x11, 0x69], "C-9", 4],
1709+
\ [[0x11, 0x6A], "C-*", 4],
1710+
\ [[0x11, 0x6B], "C-+", 4],
1711+
\ [[0x11, 0x6D], "C--", 4],
1712+
\ [[0x11, 0x70], "C-F1", 4],
1713+
\ [[0x11, 0x10, 0x70], "C-S-F1", 4],
1714+
\ [[0x11, 0x71], "C-F2", 4],
1715+
\ [[0x11, 0x10, 0x71], "C-S-F2", 4],
1716+
\ [[0x11, 0x72], "C-F3", 4],
1717+
\ [[0x11, 0x10, 0x72], "C-S-F3", 4],
1718+
\ [[0x11, 0x73], "C-F4", 4],
1719+
\ [[0x11, 0x10, 0x73], "C-S-F4", 4],
1720+
\ [[0x11, 0x74], "C-F5", 4],
1721+
\ [[0x11, 0x10, 0x74], "C-S-F5", 4],
1722+
\ [[0x11, 0x75], "C-F6", 4],
1723+
\ [[0x11, 0x10, 0x75], "C-S-F6", 4],
1724+
\ [[0x11, 0x76], "C-F7", 4],
1725+
\ [[0x11, 0x10, 0x76], "C-S-F7", 4],
1726+
\ [[0x11, 0x77], "C-F8", 4],
1727+
\ [[0x11, 0x10, 0x77], "C-S-F8", 4],
1728+
\ [[0x11, 0x78], "C-F9", 4],
1729+
\ [[0x11, 0x10, 0x78], "C-S-F9", 4],
17031730
\ ]
17041731

17051732
for [kcodes, kstr, kmod] in keytests
17061733
call SendKeys(kcodes)
17071734
let ch = getcharstr()
17081735
let mod = getcharmod()
1709-
call assert_equal(kstr, ch, $"key = {kstr}")
1710-
call assert_equal(kmod, mod)
1736+
let keycode = eval('"\<' .. kstr .. '>"')
1737+
call assert_equal(keycode, ch, $"key = {kstr}")
1738+
call assert_equal(kmod, mod, $"key = {kstr}")
17111739
endfor
17121740

17131741
bw!

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,8 @@ static char *(features[]) =
703703

704704
static int included_patches[] =
705705
{ /* Add new patch number below this line */
706+
/**/
707+
429,
706708
/**/
707709
428,
708710
/**/

0 commit comments

Comments
 (0)