annotate src/testdir/test_mswin_event.vim @ 31628:238f424acc6c v9.0.1146

patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable Commit: https://github.com/vim/vim/commit/c8b204952f0452fe1276d30ae6a5d38a3f421b95 Author: Christopher Plewright <chris@createng.com> Date: Wed Jan 4 18:06:00 2023 +0000 patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable Problem: MS-Windows: various special keys and modifiers are not mappable. Solution: Adjust the handling of keys with modifiers. (Christian Plewright, closes #11768)
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 Jan 2023 19:15:03 +0100
parents a3dca61f3ba3
children edbadc330871
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
1 " Test MS-Windows input event handling.
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
2 " Most of this works the same in Windows GUI as well as Windows console.
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 source check.vim
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 CheckMSWindows
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 source mouse.vim
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
8 " Helper function for sending a grouped sequence of low level key presses
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
9 " The modifer key(s) can be included as VK Key Codes in the sequence
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
10 " Keydown events will be sent, to to the end of the group, then keyup events
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
11 " will be sent in reverse order to release the keys.
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
12 func SendKeyGroup(keygroup)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
13 for k in a:keygroup
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
14 call test_mswin_event("key", {'event': "keydown", 'keycode': k})
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 endfor
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
16 for k in reverse(copy(a:keygroup))
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
17 call test_mswin_event("key", {'event': "keyup", 'keycode': k})
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 endfunc
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
21 " Send individual key press and release events.
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 " the modifers for the key press can be specified in the modifiers arg.
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
23 func SendKeyWithModifiers(key, modifiers)
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 let args = { }
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 let args.keycode = a:key
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 let args.modifiers = a:modifiers
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 let args.event = "keydown"
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 call test_mswin_event("key", args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 let args.event = "keyup"
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 call test_mswin_event("key", args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 unlet args
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 endfunc
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
34 " Send an individual key press, without modifiers.
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
35 func SendKey(key)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
36 call SendKeyWithModifiers(a:key, 0)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
37 endfunc
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
38
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
39 " Send a string of individual key-press events, without modifiers.
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
40 func SendKeyStr(keystring)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
41 for k in a:keystring
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
42 call SendKey(k)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
43 endfor
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
44 endfunc
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
45
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
46 " This tells Vim to execute the buffered keys as user commands,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
47 " ie. same as feekdeys with mode X would do.
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
48 func ExecuteBufferedKeys()
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
49 if has('gui_running')
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
50 call feedkeys("\<Esc>", 'Lx!')
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
51 else
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
52 call test_mswin_event("key", {'execute': v:true})
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
53 endif
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
54 endfunc
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
55
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
56 " Refer to the following page for the virtual key codes:
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
57 " https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
58 let s:VK = {
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
59 \ 'ENTER' : 0x0D,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
60 \ 'SPACE' : 0x20,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
61 \ 'SHIFT' : 0x10,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
62 \ 'LSHIFT' : 0xA0,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
63 \ 'RSHIFT' : 0xA1,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
64 \ 'CONTROL' : 0x11,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
65 \ 'LCONTROL' : 0xA2,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
66 \ 'RCONTROL' : 0xA3,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
67 \ 'MENU' : 0x12,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
68 \ 'ALT' : 0x12,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
69 \ 'LMENU' : 0xA4,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
70 \ 'LALT' : 0xA4,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
71 \ 'RMENU' : 0xA5,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
72 \ 'RALT' : 0xA5,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
73 \ 'OEM_1' : 0xBA,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
74 \ 'OEM_2' : 0xBF,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
75 \ 'OEM_3' : 0xC0,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
76 \ 'OEM_4' : 0xDB,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
77 \ 'OEM_5' : 0xDC,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
78 \ 'OEM_6' : 0xDD,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
79 \ 'OEM_7' : 0xDE,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
80 \ 'OEM_PLUS' : 0xBB,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
81 \ 'OEM_COMMA' : 0xBC,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
82 \ 'OEM_MINUS' : 0xBD,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
83 \ 'OEM_PERIOD' : 0xBE,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
84 \ 'PRIOR' : 0x21,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
85 \ 'NEXT' : 0x22,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
86 \ 'END' : 0x23,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
87 \ 'HOME' : 0x24,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
88 \ 'LEFT' : 0x25,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
89 \ 'UP' : 0x26,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
90 \ 'RIGHT' : 0x27,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
91 \ 'DOWN' : 0x28,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
92 \ 'KEY_0' : 0x30,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
93 \ 'KEY_1' : 0x31,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
94 \ 'KEY_2' : 0x32,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
95 \ 'KEY_3' : 0x33,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
96 \ 'KEY_4' : 0x34,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
97 \ 'KEY_5' : 0x35,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
98 \ 'KEY_6' : 0x36,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
99 \ 'KEY_7' : 0x37,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
100 \ 'KEY_8' : 0x38,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
101 \ 'KEY_9' : 0x39,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
102 \ 'KEY_A' : 0x41,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
103 \ 'KEY_B' : 0x42,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
104 \ 'KEY_C' : 0x43,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
105 \ 'KEY_D' : 0x44,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
106 \ 'KEY_E' : 0x45,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
107 \ 'KEY_F' : 0x46,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
108 \ 'KEY_G' : 0x47,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
109 \ 'KEY_H' : 0x48,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
110 \ 'KEY_I' : 0x49,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
111 \ 'KEY_J' : 0x4A,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
112 \ 'KEY_K' : 0x4B,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
113 \ 'KEY_L' : 0x4C,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
114 \ 'KEY_M' : 0x4D,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
115 \ 'KEY_N' : 0x4E,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
116 \ 'KEY_O' : 0x4F,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
117 \ 'KEY_P' : 0x50,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
118 \ 'KEY_Q' : 0x51,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
119 \ 'KEY_R' : 0x52,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
120 \ 'KEY_S' : 0x53,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
121 \ 'KEY_T' : 0x54,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
122 \ 'KEY_U' : 0x55,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
123 \ 'KEY_V' : 0x56,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
124 \ 'KEY_W' : 0x57,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
125 \ 'KEY_X' : 0x58,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
126 \ 'KEY_Y' : 0x59,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
127 \ 'KEY_Z' : 0x5A,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
128 \ 'NUMPAD0' : 0x60,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
129 \ 'NUMPAD1' : 0x61,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
130 \ 'NUMPAD2' : 0x62,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
131 \ 'NUMPAD3' : 0x63,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
132 \ 'NUMPAD4' : 0x64,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
133 \ 'NUMPAD5' : 0x65,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
134 \ 'NUMPAD6' : 0x66,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
135 \ 'NUMPAD7' : 0x67,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
136 \ 'NUMPAD8' : 0x68,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
137 \ 'NUMPAD9' : 0x69,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
138 \ 'MULTIPLY' : 0x6A,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
139 \ 'ADD' : 0x6B,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
140 \ 'SUBTRACT' : 0x6D,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
141 \ 'F1' : 0x70,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
142 \ 'F2' : 0x71,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
143 \ 'F3' : 0x72,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
144 \ 'F4' : 0x73,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
145 \ 'F5' : 0x74,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
146 \ 'F6' : 0x75,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
147 \ 'F7' : 0x76,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
148 \ 'F8' : 0x77,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
149 \ 'F9' : 0x78,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
150 \ 'F10' : 0x79,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
151 \ 'F11' : 0x7A,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
152 \ 'F12' : 0x7B,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
153 \ 'DELETE' : 0x2E,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
154 \ 'BACK' : 0x08,
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
155 \ 'ESCAPE' : 0x1B
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
156 \ }
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
157
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
158 let s:vim_MOD_MASK_SHIFT = 0x02
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
159 let s:vim_MOD_MASK_CTRL = 0x04
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
160 let s:vim_MOD_MASK_ALT = 0x08
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
161
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
162 let s:vim_key_modifiers = [
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
163 \ ["", 0, []],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
164 \ ["S-", 2, [s:VK.SHIFT]],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
165 \ ["C-", 4, [s:VK.CONTROL]],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
166 \ ["C-S-", 6, [s:VK.CONTROL, s:VK.SHIFT]],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
167 \ ["A-", 8, [s:VK.MENU]],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
168 \ ["A-S-", 10, [s:VK.MENU, s:VK.SHIFT]],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
169 \ ["A-C-", 12, [s:VK.MENU, s:VK.CONTROL]],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
170 \ ["A-C-S-", 14, [s:VK.MENU, s:VK.CONTROL, s:VK.SHIFT]],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
171 \]
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
172
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
173 " Assuming Standard US PC Keyboard layout
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
174 let s:test_ascii_key_chars = [
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
175 \ [[s:VK.SPACE], ' '],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
176 \ [[s:VK.OEM_1], ';'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
177 \ [[s:VK.OEM_2], '/'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
178 \ [[s:VK.OEM_3], '`'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
179 \ [[s:VK.OEM_4], '['],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
180 \ [[s:VK.OEM_5], '\'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
181 \ [[s:VK.OEM_6], ']'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
182 \ [[s:VK.OEM_7], ''''],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
183 \ [[s:VK.OEM_PLUS], '='],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
184 \ [[s:VK.OEM_COMMA], ','],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
185 \ [[s:VK.OEM_MINUS], '-'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
186 \ [[s:VK.OEM_PERIOD], '.'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
187 \ [[s:VK.SHIFT, s:VK.OEM_1], ':'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
188 \ [[s:VK.SHIFT, s:VK.OEM_2], '?'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
189 \ [[s:VK.SHIFT, s:VK.OEM_3], '~'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
190 \ [[s:VK.SHIFT, s:VK.OEM_4], '{'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
191 \ [[s:VK.SHIFT, s:VK.OEM_5], '|'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
192 \ [[s:VK.SHIFT, s:VK.OEM_6], '}'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
193 \ [[s:VK.SHIFT, s:VK.OEM_7], '"'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
194 \ [[s:VK.SHIFT, s:VK.OEM_PLUS], '+'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
195 \ [[s:VK.SHIFT, s:VK.OEM_COMMA], '<'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
196 \ [[s:VK.SHIFT, s:VK.OEM_MINUS], '_'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
197 \ [[s:VK.SHIFT, s:VK.OEM_PERIOD], '>'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
198 \ [[s:VK.KEY_1], '1'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
199 \ [[s:VK.KEY_2], '2'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
200 \ [[s:VK.KEY_3], '3'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
201 \ [[s:VK.KEY_4], '4'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
202 \ [[s:VK.KEY_5], '5'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
203 \ [[s:VK.KEY_6], '6'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
204 \ [[s:VK.KEY_7], '7'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
205 \ [[s:VK.KEY_8], '8'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
206 \ [[s:VK.KEY_9], '9'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
207 \ [[s:VK.KEY_0], '0'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
208 \ [[s:VK.SHIFT, s:VK.KEY_1], '!'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
209 \ [[s:VK.SHIFT, s:VK.KEY_2], '@'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
210 \ [[s:VK.SHIFT, s:VK.KEY_3], '#'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
211 \ [[s:VK.SHIFT, s:VK.KEY_4], '$'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
212 \ [[s:VK.SHIFT, s:VK.KEY_5], '%'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
213 \ [[s:VK.SHIFT, s:VK.KEY_6], '^'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
214 \ [[s:VK.SHIFT, s:VK.KEY_7], '&'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
215 \ [[s:VK.SHIFT, s:VK.KEY_8], '*'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
216 \ [[s:VK.SHIFT, s:VK.KEY_9], '('],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
217 \ [[s:VK.SHIFT, s:VK.KEY_0], ')'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
218 \ [[s:VK.KEY_A], 'a'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
219 \ [[s:VK.KEY_B], 'b'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
220 \ [[s:VK.KEY_C], 'c'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
221 \ [[s:VK.KEY_D], 'd'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
222 \ [[s:VK.KEY_E], 'e'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
223 \ [[s:VK.KEY_F], 'f'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
224 \ [[s:VK.KEY_G], 'g'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
225 \ [[s:VK.KEY_H], 'h'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
226 \ [[s:VK.KEY_I], 'i'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
227 \ [[s:VK.KEY_J], 'j'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
228 \ [[s:VK.KEY_K], 'k'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
229 \ [[s:VK.KEY_L], 'l'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
230 \ [[s:VK.KEY_M], 'm'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
231 \ [[s:VK.KEY_N], 'n'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
232 \ [[s:VK.KEY_O], 'o'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
233 \ [[s:VK.KEY_P], 'p'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
234 \ [[s:VK.KEY_Q], 'q'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
235 \ [[s:VK.KEY_R], 'r'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
236 \ [[s:VK.KEY_S], 's'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
237 \ [[s:VK.KEY_T], 't'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
238 \ [[s:VK.KEY_U], 'u'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
239 \ [[s:VK.KEY_V], 'v'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
240 \ [[s:VK.KEY_W], 'w'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
241 \ [[s:VK.KEY_X], 'x'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
242 \ [[s:VK.KEY_Y], 'y'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
243 \ [[s:VK.KEY_Z], 'z'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
244 \ [[s:VK.SHIFT, s:VK.KEY_A], 'A'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
245 \ [[s:VK.SHIFT, s:VK.KEY_B], 'B'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
246 \ [[s:VK.SHIFT, s:VK.KEY_C], 'C'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
247 \ [[s:VK.SHIFT, s:VK.KEY_D], 'D'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
248 \ [[s:VK.SHIFT, s:VK.KEY_E], 'E'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
249 \ [[s:VK.SHIFT, s:VK.KEY_F], 'F'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
250 \ [[s:VK.SHIFT, s:VK.KEY_G], 'G'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
251 \ [[s:VK.SHIFT, s:VK.KEY_H], 'H'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
252 \ [[s:VK.SHIFT, s:VK.KEY_I], 'I'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
253 \ [[s:VK.SHIFT, s:VK.KEY_J], 'J'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
254 \ [[s:VK.SHIFT, s:VK.KEY_K], 'K'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
255 \ [[s:VK.SHIFT, s:VK.KEY_L], 'L'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
256 \ [[s:VK.SHIFT, s:VK.KEY_M], 'M'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
257 \ [[s:VK.SHIFT, s:VK.KEY_N], 'N'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
258 \ [[s:VK.SHIFT, s:VK.KEY_O], 'O'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
259 \ [[s:VK.SHIFT, s:VK.KEY_P], 'P'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
260 \ [[s:VK.SHIFT, s:VK.KEY_Q], 'Q'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
261 \ [[s:VK.SHIFT, s:VK.KEY_R], 'R'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
262 \ [[s:VK.SHIFT, s:VK.KEY_S], 'S'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
263 \ [[s:VK.SHIFT, s:VK.KEY_T], 'T'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
264 \ [[s:VK.SHIFT, s:VK.KEY_U], 'U'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
265 \ [[s:VK.SHIFT, s:VK.KEY_V], 'V'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
266 \ [[s:VK.SHIFT, s:VK.KEY_W], 'W'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
267 \ [[s:VK.SHIFT, s:VK.KEY_X], 'X'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
268 \ [[s:VK.SHIFT, s:VK.KEY_Y], 'Y'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
269 \ [[s:VK.SHIFT, s:VK.KEY_Z], 'Z'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
270 \ [[s:VK.CONTROL, s:VK.KEY_A], 0x01],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
271 \ [[s:VK.CONTROL, s:VK.KEY_B], 0x02],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
272 \ [[s:VK.CONTROL, s:VK.KEY_C], 0x03],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
273 \ [[s:VK.CONTROL, s:VK.KEY_D], 0x04],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
274 \ [[s:VK.CONTROL, s:VK.KEY_E], 0x05],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
275 \ [[s:VK.CONTROL, s:VK.KEY_F], 0x06],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
276 \ [[s:VK.CONTROL, s:VK.KEY_G], 0x07],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
277 \ [[s:VK.CONTROL, s:VK.KEY_H], 0x08],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
278 \ [[s:VK.CONTROL, s:VK.KEY_I], 0x09],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
279 \ [[s:VK.CONTROL, s:VK.KEY_J], 0x0A],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
280 \ [[s:VK.CONTROL, s:VK.KEY_K], 0x0B],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
281 \ [[s:VK.CONTROL, s:VK.KEY_L], 0x0C],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
282 \ [[s:VK.CONTROL, s:VK.KEY_M], 0x0D],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
283 \ [[s:VK.CONTROL, s:VK.KEY_N], 0x0E],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
284 \ [[s:VK.CONTROL, s:VK.KEY_O], 0x0F],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
285 \ [[s:VK.CONTROL, s:VK.KEY_P], 0x10],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
286 \ [[s:VK.CONTROL, s:VK.KEY_Q], 0x11],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
287 \ [[s:VK.CONTROL, s:VK.KEY_R], 0x12],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
288 \ [[s:VK.CONTROL, s:VK.KEY_S], 0x13],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
289 \ [[s:VK.CONTROL, s:VK.KEY_T], 0x14],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
290 \ [[s:VK.CONTROL, s:VK.KEY_U], 0x15],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
291 \ [[s:VK.CONTROL, s:VK.KEY_V], 0x16],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
292 \ [[s:VK.CONTROL, s:VK.KEY_W], 0x17],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
293 \ [[s:VK.CONTROL, s:VK.KEY_X], 0x18],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
294 \ [[s:VK.CONTROL, s:VK.KEY_Y], 0x19],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
295 \ [[s:VK.CONTROL, s:VK.KEY_Z], 0x1A],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
296 \ [[s:VK.CONTROL, s:VK.OEM_4], 0x1B],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
297 \ [[s:VK.CONTROL, s:VK.OEM_5], 0x1C],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
298 \ [[s:VK.CONTROL, s:VK.OEM_6], 0x1D],
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
299 \ [[s:VK.CONTROL, s:VK.KEY_6], 0x1E],
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
300 \ [[s:VK.CONTROL, s:VK.OEM_MINUS], 0x1F],
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
301 \ ]
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
302
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
303 let s:test_extra_key_chars = [
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
304 \ [[s:VK.ALT, s:VK.KEY_1], '±'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
305 \ [[s:VK.ALT, s:VK.KEY_2], '²'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
306 \ [[s:VK.ALT, s:VK.KEY_3], '³'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
307 \ [[s:VK.ALT, s:VK.KEY_4], '´'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
308 \ [[s:VK.ALT, s:VK.KEY_5], 'µ'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
309 \ [[s:VK.ALT, s:VK.KEY_6], '¶'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
310 \ [[s:VK.ALT, s:VK.KEY_7], '·'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
311 \ [[s:VK.ALT, s:VK.KEY_8], '¸'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
312 \ [[s:VK.ALT, s:VK.KEY_9], '¹'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
313 \ [[s:VK.ALT, s:VK.KEY_0], '°'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
314 \ [[s:VK.ALT, s:VK.KEY_A], 'á'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
315 \ [[s:VK.ALT, s:VK.KEY_B], 'â'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
316 \ [[s:VK.ALT, s:VK.KEY_C], 'ã'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
317 \ [[s:VK.ALT, s:VK.KEY_D], 'ä'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
318 \ [[s:VK.ALT, s:VK.KEY_E], 'Ã¥'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
319 \ [[s:VK.ALT, s:VK.KEY_F], 'æ'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
320 \ [[s:VK.ALT, s:VK.KEY_G], 'ç'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
321 \ [[s:VK.ALT, s:VK.KEY_H], 'è'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
322 \ [[s:VK.ALT, s:VK.KEY_I], 'é'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
323 \ [[s:VK.ALT, s:VK.KEY_J], 'ê'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
324 \ [[s:VK.ALT, s:VK.KEY_K], 'ë'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
325 \ [[s:VK.ALT, s:VK.KEY_L], 'ì'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
326 \ [[s:VK.ALT, s:VK.KEY_M], 'í'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
327 \ [[s:VK.ALT, s:VK.KEY_N], 'î'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
328 \ [[s:VK.ALT, s:VK.KEY_O], 'ï'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
329 \ [[s:VK.ALT, s:VK.KEY_P], 'ð'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
330 \ [[s:VK.ALT, s:VK.KEY_Q], 'ñ'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
331 \ [[s:VK.ALT, s:VK.KEY_R], 'ò'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
332 \ [[s:VK.ALT, s:VK.KEY_S], 'ó'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
333 \ [[s:VK.ALT, s:VK.KEY_T], 'ô'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
334 \ [[s:VK.ALT, s:VK.KEY_U], 'õ'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
335 \ [[s:VK.ALT, s:VK.KEY_V], 'ö'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
336 \ [[s:VK.ALT, s:VK.KEY_W], '÷'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
337 \ [[s:VK.ALT, s:VK.KEY_X], 'ø'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
338 \ [[s:VK.ALT, s:VK.KEY_Y], 'ù'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
339 \ [[s:VK.ALT, s:VK.KEY_Z], 'ú'],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
340 \ ]
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
341
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
342 func s:LoopTestKeyArray(arr)
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
343 " flush out anything in the typeahead buffer
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
344 while getchar(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
345 endwhile
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
346
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
347 for [kcodes, kstr] in a:arr
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
348 " Send as a sequence of key presses.
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
349 call SendKeyGroup(kcodes)
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
350 let ch = getcharstr(0)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
351 " need to deal a bit differently with the non-printable ascii chars < 0x20
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
352 if kstr < 0x20 && index([s:VK.CONTROL, s:VK.LCONTROL, s:VK.RCONTROL], kcodes[0]) >= 0
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
353 call assert_equal(nr2char(kstr), $"{ch}")
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
354 else
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
355 call assert_equal(kstr, $"{ch}")
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
356 endif
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
357 let mod_mask = getcharmod()
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
358 " the mod_mask is zero when no modifiers are used
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
359 " and when the virtual termcap maps the character
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
360 call assert_equal(0, mod_mask, $"key = {kstr}")
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
361
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
362 " Send as a single key press with a modifers mask.
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
363 let modifiers = 0
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
364 let key = kcodes[0]
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
365 for key in kcodes
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
366 if index([s:VK.SHIFT, s:VK.LSHIFT, s:VK.RSHIFT], key) >= 0
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
367 let modifiers = modifiers + s:vim_MOD_MASK_SHIFT
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
368 endif
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
369 if index([s:VK.CONTROL, s:VK.LCONTROL, s:VK.RCONTROL], key) >= 0
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
370 let modifiers = modifiers + s:vim_MOD_MASK_CTRL
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
371 endif
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
372 if index([s:VK.ALT, s:VK.LALT, s:VK.RALT], key) >= 0
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
373 let modifiers = modifiers + s:vim_MOD_MASK_ALT
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
374 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
375 endfor
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
376 call SendKeyWithModifiers(key, modifiers)
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
377 let ch = getcharstr(0)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
378 " need to deal a bit differently with the non-printable ascii chars < 0x20
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
379 if kstr < 0x20 && index([s:VK.CONTROL, s:VK.LCONTROL, s:VK.RCONTROL], kcodes[0]) >= 0
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
380 call assert_equal(nr2char(kstr), $"{ch}")
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
381 else
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
382 call assert_equal(kstr, $"{ch}")
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
383 endif
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
384 let mod_mask = getcharmod()
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
385 " the mod_mask is zero when no modifiers are used
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
386 " and when the virtual termcap maps the character
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
387 call assert_equal(0, mod_mask, $"key = {kstr}")
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
388 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
389
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
390 " flush out anything in the typeahead buffer
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
391 while getchar(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
392 endwhile
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
393
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
394 endfunc
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
395
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
396 " Test MS-Windows key events
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
397 func Test_mswin_key_event()
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
398 CheckMSWindows
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
399 new
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
400
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
401 call s:LoopTestKeyArray(s:test_ascii_key_chars)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
402
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
403 if !has('gui_running')
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
404 call s:LoopTestKeyArray(s:test_extra_key_chars)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
405 endif
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
406
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
407 " Test keyboard codes for digits
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
408 " (0x30 - 0x39) : VK_0 - VK_9 are the same as ASCII '0' - '9'
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
409 for kc in range(48, 57)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
410 call SendKey(kc)
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
411 let ch = getcharstr(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
412 call assert_equal(nr2char(kc), ch)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
413 call SendKeyWithModifiers(kc, 0)
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
414 let ch = getcharstr(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
415 call assert_equal(nr2char(kc), ch)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
416 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
417
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
418 " Test keyboard codes for Alt-0 to Alt-9
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
419 " Expect +128 from the digit char codes
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
420 for modkey in [s:VK.ALT, s:VK.LALT, s:VK.RALT]
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
421 for kc in range(48, 57)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
422 call SendKeyGroup([modkey, kc])
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
423 let ch = getchar(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
424 call assert_equal(kc+128, ch)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
425 call SendKeyWithModifiers(kc, s:vim_MOD_MASK_ALT)
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
426 let ch = getchar(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
427 call assert_equal(kc+128, ch)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
428 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
429 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
430
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
431 " Test for lowercase 'a' to 'z', VK codes 65(0x41) - 90(0x5A)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
432 " Note: VK_A-VK_Z virtual key codes coincide with uppercase ASCII codes A-Z.
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
433 " eg VK_A is 65, and the ASCII character code for uppercase 'A' is also 65.
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
434 " Caution: these are interpreted as lowercase when Shift is NOT pressed.
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
435 " eg, sending VK_A (65) 'A' Key code without shift modifier, will produce ASCII
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
436 " char 'a' (91) as the output. The ASCII codes for the lowercase letters are
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
437 " numbered 32 higher than their uppercase versions.
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
438 for kc in range(65, 90)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
439 call SendKey(kc)
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
440 let ch = getcharstr(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
441 call assert_equal(nr2char(kc + 32), ch)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
442 call SendKeyWithModifiers(kc, 0)
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
443 let ch = getcharstr(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
444 call assert_equal(nr2char(kc + 32), ch)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
445 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
446
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
447 " Test for Uppercase 'A' - 'Z' keys
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
448 " ie. with VK_SHIFT, expect the keycode = character code.
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
449 for modkey in [s:VK.SHIFT, s:VK.LSHIFT, s:VK.RSHIFT]
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
450 for kc in range(65, 90)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
451 call SendKeyGroup([modkey, kc])
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
452 let ch = getcharstr(0)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
453 call assert_equal(nr2char(kc), ch)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
454 call SendKeyWithModifiers(kc, s:vim_MOD_MASK_SHIFT)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
455 let ch = getcharstr(0)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
456 call assert_equal(nr2char(kc), ch)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
457 endfor
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
458 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
459
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
460 " Test for <Ctrl-A> to <Ctrl-Z> keys
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
461 " Expect the unicode characters 0x01 to 0x1A
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
462 for modkey in [s:VK.CONTROL, s:VK.LCONTROL, s:VK.RCONTROL]
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
463 for kc in range(65, 90)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
464 call SendKeyGroup([modkey, kc])
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
465 let ch = getcharstr(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
466 call assert_equal(nr2char(kc - 64), ch)
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
467 call SendKeyWithModifiers(kc, s:vim_MOD_MASK_CTRL)
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
468 let ch = getcharstr(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
469 call assert_equal(nr2char(kc - 64), ch)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
470 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
471 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
472
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
473 " Windows intercepts some of these keys in the GUI.
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
474 if !has("gui_running")
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
475 " Test for <Alt-A> to <Alt-Z> keys
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
476 " Expect the unicode characters 0xE1 to 0xFA
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
477 " ie. 160 higher than the lowercase equivalent
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
478 for modkey in [s:VK.ALT, s:VK.LALT, s:VK.RALT]
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
479 for kc in range(65, 90)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
480 call SendKeyGroup([modkey, kc])
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
481 let ch = getchar(0)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
482 call assert_equal(kc+160, ch)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
483 call SendKeyWithModifiers(kc, s:vim_MOD_MASK_ALT)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
484 let ch = getchar(0)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
485 call assert_equal(kc+160, ch)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
486 endfor
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
487 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
488 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
489
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
490 " Test for Function Keys 'F1' to 'F12'
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
491 " VK codes 112(0x70) - 123(0x7B)
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
492 " Also with ALL permutatios of modifiers; Shift, Ctrl & Alt
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
493 " NOTE: Windows intercepts some of these keys in the GUI
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
494 if !has("gui_running")
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
495 for [mod_str, vim_mod_mask, mod_keycodes] in s:vim_key_modifiers
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
496 for n in range(1, 12)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
497 let kstr = $"{mod_str}F{n}"
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
498 let keycode = eval('"\<' .. kstr .. '>"')
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
499 " flush out anything in the typeahead buffer
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
500 while getchar(0)
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
501 endwhile
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
502 " call SendKeyGroup(mod_keycodes + [111+n])
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
503 call SendKeyWithModifiers(111+n, vim_mod_mask)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
504 let ch = getcharstr(0)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
505 let mod_mask = getcharmod()
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
506 call assert_equal(keycode, $"{ch}", $"key = {kstr}")
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
507 " workaround for the virtual termcap maps changing the character instead
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
508 " of sending Shift
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
509 for mod_key in mod_keycodes
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
510 if index([s:VK.SHIFT, s:VK.LSHIFT, s:VK.RSHIFT], mod_key) >= 0
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
511 let mod_mask = mod_mask + s:vim_MOD_MASK_SHIFT
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
512 endif
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
513 endfor
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
514 call assert_equal(vim_mod_mask, mod_mask, $"mod = {vim_mod_mask} for key = {kstr}")
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
515 endfor
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
516 endfor
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
517 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
518
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
519 " Test for the various Ctrl and Shift key combinations.
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
520 let keytests = [
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
521 \ [[s:VK.SHIFT, s:VK.PRIOR], "S-Pageup", 2],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
522 \ [[s:VK.LSHIFT, s:VK.PRIOR], "S-Pageup", 2],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
523 \ [[s:VK.RSHIFT, s:VK.PRIOR], "S-Pageup", 2],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
524 \ [[s:VK.CONTROL, s:VK.PRIOR], "C-Pageup", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
525 \ [[s:VK.LCONTROL, s:VK.PRIOR], "C-Pageup", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
526 \ [[s:VK.RCONTROL, s:VK.PRIOR], "C-Pageup", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
527 \ [[s:VK.CONTROL, s:VK.SHIFT, s:VK.PRIOR], "C-S-Pageup", 6],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
528 \ [[s:VK.SHIFT, s:VK.NEXT], "S-PageDown", 2],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
529 \ [[s:VK.LSHIFT, s:VK.NEXT], "S-PageDown", 2],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
530 \ [[s:VK.RSHIFT, s:VK.NEXT], "S-PageDown", 2],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
531 \ [[s:VK.CONTROL, s:VK.NEXT], "C-PageDown", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
532 \ [[s:VK.LCONTROL, s:VK.NEXT], "C-PageDown", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
533 \ [[s:VK.RCONTROL, s:VK.NEXT], "C-PageDown", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
534 \ [[s:VK.CONTROL, s:VK.SHIFT, s:VK.NEXT], "C-S-PageDown", 6],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
535 \ [[s:VK.SHIFT, s:VK.END], "S-End", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
536 \ [[s:VK.CONTROL, s:VK.END], "C-End", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
537 \ [[s:VK.CONTROL, s:VK.SHIFT, s:VK.END], "C-S-End", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
538 \ [[s:VK.SHIFT, s:VK.HOME], "S-Home", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
539 \ [[s:VK.CONTROL, s:VK.HOME], "C-Home", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
540 \ [[s:VK.CONTROL, s:VK.SHIFT, s:VK.HOME], "C-S-Home", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
541 \ [[s:VK.SHIFT, s:VK.LEFT], "S-Left", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
542 \ [[s:VK.CONTROL, s:VK.LEFT], "C-Left", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
543 \ [[s:VK.CONTROL, s:VK.SHIFT, s:VK.LEFT], "C-S-Left", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
544 \ [[s:VK.SHIFT, s:VK.UP], "S-Up", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
545 \ [[s:VK.CONTROL, s:VK.UP], "C-Up", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
546 \ [[s:VK.CONTROL, s:VK.SHIFT, s:VK.UP], "C-S-Up", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
547 \ [[s:VK.SHIFT, s:VK.RIGHT], "S-Right", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
548 \ [[s:VK.CONTROL, s:VK.RIGHT], "C-Right", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
549 \ [[s:VK.CONTROL, s:VK.SHIFT, s:VK.RIGHT], "C-S-Right", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
550 \ [[s:VK.SHIFT, s:VK.DOWN], "S-Down", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
551 \ [[s:VK.CONTROL, s:VK.DOWN], "C-Down", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
552 \ [[s:VK.CONTROL, s:VK.SHIFT, s:VK.DOWN], "C-S-Down", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
553 \ [[s:VK.CONTROL, s:VK.KEY_0], "C-0", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
554 \ [[s:VK.CONTROL, s:VK.KEY_1], "C-1", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
555 \ [[s:VK.CONTROL, s:VK.KEY_2], "C-@", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
556 \ [[s:VK.CONTROL, s:VK.KEY_3], "C-3", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
557 \ [[s:VK.CONTROL, s:VK.KEY_4], "C-4", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
558 \ [[s:VK.CONTROL, s:VK.KEY_5], "C-5", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
559 \ [[s:VK.CONTROL, s:VK.KEY_6], "C-^", 0],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
560 \ [[s:VK.CONTROL, s:VK.KEY_7], "C-7", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
561 \ [[s:VK.CONTROL, s:VK.KEY_8], "C-8", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
562 \ [[s:VK.CONTROL, s:VK.KEY_9], "C-9", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
563 \ [[s:VK.CONTROL, s:VK.NUMPAD0], "C-0", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
564 \ [[s:VK.CONTROL, s:VK.NUMPAD1], "C-1", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
565 \ [[s:VK.CONTROL, s:VK.NUMPAD2], "C-2", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
566 \ [[s:VK.CONTROL, s:VK.NUMPAD3], "C-3", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
567 \ [[s:VK.CONTROL, s:VK.NUMPAD4], "C-4", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
568 \ [[s:VK.CONTROL, s:VK.NUMPAD5], "C-5", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
569 \ [[s:VK.CONTROL, s:VK.NUMPAD6], "C-6", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
570 \ [[s:VK.CONTROL, s:VK.NUMPAD7], "C-7", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
571 \ [[s:VK.CONTROL, s:VK.NUMPAD8], "C-8", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
572 \ [[s:VK.CONTROL, s:VK.NUMPAD9], "C-9", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
573 \ [[s:VK.CONTROL, s:VK.MULTIPLY], "C-*", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
574 \ [[s:VK.CONTROL, s:VK.ADD], "C-+", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
575 \ [[s:VK.CONTROL, s:VK.SUBTRACT], "C--", 4],
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
576 \ [[s:VK.CONTROL, s:VK.OEM_MINUS], "C-_", 0]
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
577 \ ]
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
578
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
579 for [kcodes, kstr, kmod] in keytests
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
580 call SendKeyGroup(kcodes)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
581 let ch = getcharstr(0)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
582 let mod = getcharmod()
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
583 let keycode = eval('"\<' .. kstr .. '>"')
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
584 call assert_equal(keycode, ch, $"key = {kstr}")
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
585 call assert_equal(kmod, mod, $"mod = {kmod} key = {kstr}")
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
586 endfor
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
587
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
588 bw!
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
589 endfunc
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
590
31559
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
591
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
592 " Test for QWERTY Ctrl+- which should result in ^_
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
593 " issue #10817
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
594 func Test_QWERTY_Ctrl_minus()
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
595 CheckMSWindows
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
596 new
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
597
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
598 call SendKeyGroup([s:VK.CONTROL, s:VK.OEM_MINUS])
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
599 let ch = getcharstr(0)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
600 call assert_equal(nr2char(0x1f),ch)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
601
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
602 call SendKey(s:VK.KEY_I)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
603 call SendKeyGroup([s:VK.CONTROL, s:VK.SUBTRACT])
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
604 call SendKey(s:VK.ESCAPE)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
605 call ExecuteBufferedKeys()
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
606 call assert_equal('-', getline('$'))
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
607
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
608 %d _
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
609 imapclear
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
610 imap <C-_> BINGO
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
611 call SendKey(s:VK.KEY_I)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
612 call SendKeyGroup([s:VK.CONTROL, s:VK.OEM_MINUS])
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
613 call SendKey(s:VK.ESCAPE)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
614 call ExecuteBufferedKeys()
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
615 call assert_equal('BINGO', getline('$'))
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
616
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
617 %d _
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
618 imapclear
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
619 exec "imap \x1f BILBO"
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
620 call SendKey(s:VK.KEY_I)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
621 call SendKeyGroup([s:VK.CONTROL, s:VK.OEM_MINUS])
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
622 call SendKey(s:VK.ESCAPE)
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
623 call ExecuteBufferedKeys()
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
624 call assert_equal('BILBO', getline('$'))
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
625
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
626 imapclear
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
627 bw!
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
628 endfunc
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
629
a3dca61f3ba3 patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents: 31503
diff changeset
630 " Test MS-Windows mouse events
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
631 func Test_mswin_mouse_event()
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
632 CheckMSWindows
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
633 new
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
634
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
635 set mousemodel=extend
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
636 call test_override('no_query_mouse', 1)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
637 call WaitForResponses()
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
638
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
639 let msg = ''
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
640
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
641 call setline(1, ['one two three', 'four five six'])
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
642
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
643 " Test mouse movement
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
644 " by default, no mouse move events are generated
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
645 " this setting enables it to generate move events
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
646 set mousemev
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
647
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
648 if !has('gui_running')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
649 " console version needs a button pressed,
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
650 " otherwise it ignores mouse movements.
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
651 call MouseLeftClick(2, 3)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
652 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
653 call MSWinMouseEvent(0x700, 8, 13, 0, 0, 0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
654 if has('gui_running')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
655 call feedkeys("\<Esc>", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
656 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
657 let pos = getmousepos()
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
658 call assert_equal(8, pos.screenrow)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
659 call assert_equal(13, pos.screencol)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
660
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
661 if !has('gui_running')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
662 call MouseLeftClick(2, 3)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
663 call MSWinMouseEvent(0x700, 6, 4, 1, 0, 0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
664 let pos = getmousepos()
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
665 call assert_equal(6, pos.screenrow)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
666 call assert_equal(4, pos.screencol)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
667 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
668
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
669 " test cells vs pixels
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
670 if has('gui_running')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
671 let args = { }
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
672 let args.row = 9
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
673 let args.col = 7
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
674 let args.move = 1
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
675 let args.cell = 1
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
676 call test_mswin_event("mouse", args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
677 call feedkeys("\<Esc>", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
678 let pos = getmousepos()
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
679 call assert_equal(9, pos.screenrow)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
680 call assert_equal(7, pos.screencol)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
681
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
682 let args.cell = 0
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
683 call test_mswin_event("mouse", args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
684 call feedkeys("\<Esc>", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
685 let pos = getmousepos()
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
686 call assert_equal(1, pos.screenrow)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
687 call assert_equal(1, pos.screencol)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
688
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
689 unlet args
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
690 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
691
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
692 " finish testing mouse movement
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
693 set mousemev&
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
694
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
695 " place the cursor using left click and release in normal mode
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
696 call MouseLeftClick(2, 4)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
697 call MouseLeftRelease(2, 4)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
698 if has('gui_running')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
699 call feedkeys("\<Esc>", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
700 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
701 call assert_equal([0, 2, 4, 0], getpos('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
702
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
703 " select and yank a word
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
704 let @" = ''
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
705 call MouseLeftClick(1, 9)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
706 let args = #{button: 0, row: 1, col: 9, multiclick: 1, modifiers: 0}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
707 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
708 call MouseLeftRelease(1, 9)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
709 call feedkeys("y", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
710 call assert_equal('three', @")
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
711
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
712 " create visual selection using right click
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
713 let @" = ''
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
714
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
715 call MouseLeftClick(2 ,6)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
716 call MouseLeftRelease(2, 6)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
717 call MouseRightClick(2, 13)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
718 call MouseRightRelease(2, 13)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
719 call feedkeys("y", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
720 call assert_equal('five six', @")
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
721
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
722 " paste using middle mouse button
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
723 let @* = 'abc '
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
724 call feedkeys('""', 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
725 call MouseMiddleClick(1, 9)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
726 call MouseMiddleRelease(1, 9)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
727 if has('gui_running')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
728 call feedkeys("\<Esc>", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
729 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
730 call assert_equal(['one two abc three', 'four five six'], getline(1, '$'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
731
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
732 " test mouse scrolling (aka touchpad scrolling.)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
733 %d _
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
734 set scrolloff=0
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
735 call setline(1, range(1, 100))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
736
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
737 " Scroll Down
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
738 call MouseWheelDown(2, 1)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
739 call MouseWheelDown(2, 1)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
740 call MouseWheelDown(2, 1)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
741 call feedkeys("H", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
742 call assert_equal(10, line('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
743
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
744 " Scroll Up
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
745 call MouseWheelUp(2, 1)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
746 call MouseWheelUp(2, 1)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
747 call feedkeys("H", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
748 call assert_equal(4, line('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
749
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
750 " Shift Scroll Down
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
751 call MouseShiftWheelDown(2, 1)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
752 call feedkeys("H", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
753 " should scroll from where it is (4) + visible buffer height - cmdheight
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
754 let shift_scroll_height = line('w$') - line('w0') - &cmdheight
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
755 call assert_equal(4 + shift_scroll_height, line('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
756
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
757 " Shift Scroll Up
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
758 call MouseShiftWheelUp(2, 1)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
759 call feedkeys("H", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
760 call assert_equal(4, line('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
761
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
762 if !has('gui_running')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
763 " Shift Scroll Down (using MOD)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
764 call MSWinMouseEvent(0x100, 2, 1, 0, 0, 0x04)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
765 call feedkeys("H", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
766 " should scroll from where it is (4) + visible buffer height - cmdheight
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
767 let shift_scroll_height = line('w$') - line('w0') - &cmdheight
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
768 call assert_equal(4 + shift_scroll_height, line('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
769
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
770 " Shift Scroll Up (using MOD)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
771 call MSWinMouseEvent(0x200, 2, 1, 0, 0, 0x04)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
772 call feedkeys("H", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
773 call assert_equal(4, line('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
774 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
775
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
776 set scrolloff&
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
777
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
778 %d _
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
779 set nowrap
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
780 " make the buffer 500 wide.
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
781 call setline(1, range(10)->join('')->repeat(50))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
782 " Scroll Right
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
783 call MouseWheelRight(1, 5)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
784 call MouseWheelRight(1, 10)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
785 call MouseWheelRight(1, 15)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
786 call feedkeys('g0', 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
787 call assert_equal(19, col('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
788
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
789 " Scroll Left
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
790 call MouseWheelLeft(1, 15)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
791 call MouseWheelLeft(1, 10)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
792 call feedkeys('g0', 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
793 call assert_equal(7, col('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
794
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
795 " Shift Scroll Right
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
796 call MouseShiftWheelRight(1, 10)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
797 call feedkeys('g0', 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
798 " should scroll from where it is (7) + window width
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
799 call assert_equal(7 + winwidth(0), col('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
800
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
801 " Shift Scroll Left
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
802 call MouseShiftWheelLeft(1, 50)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
803 call feedkeys('g0', 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
804 call assert_equal(7, col('.'))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
805 set wrap&
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
806
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
807 %d _
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
808 call setline(1, repeat([repeat('a', 60)], 10))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
809
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
810 " record various mouse events
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
811 let mouseEventNames = [
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
812 \ 'LeftMouse', 'LeftRelease', '2-LeftMouse', '3-LeftMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
813 \ 'S-LeftMouse', 'A-LeftMouse', 'C-LeftMouse', 'MiddleMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
814 \ 'MiddleRelease', '2-MiddleMouse', '3-MiddleMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
815 \ 'S-MiddleMouse', 'A-MiddleMouse', 'C-MiddleMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
816 \ 'RightMouse', 'RightRelease', '2-RightMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
817 \ '3-RightMouse', 'S-RightMouse', 'A-RightMouse', 'C-RightMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
818 \ ]
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
819 let mouseEventCodes = map(copy(mouseEventNames), "'<' .. v:val .. '>'")
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
820 let g:events = []
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
821 for e in mouseEventCodes
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
822 exe 'nnoremap ' .. e .. ' <Cmd>call add(g:events, "' ..
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
823 \ substitute(e, '[<>]', '', 'g') .. '")<CR>'
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
824 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
825
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
826 " Test various mouse buttons
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
827 "(0 - Left, 1 - Middle, 2 - Right,
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
828 " 0x300 - MOUSE_X1/FROM_LEFT_3RD_BUTTON,
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
829 " 0x400 - MOUSE_X2/FROM_LEFT_4TH_BUTTON)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
830 for button in [0, 1, 2, 0x300, 0x400]
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
831 " Single click
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
832 let args = #{button: button, row: 2, col: 5, multiclick: 0, modifiers: 0}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
833 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
834 let args.button = 3
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
835 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
836
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
837 " Double Click
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
838 let args.button = button
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
839 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
840 let args.multiclick = 1
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
841 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
842 let args.button = 3
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
843 let args.multiclick = 0
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
844 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
845
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
846 " Triple Click
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
847 let args.button = button
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
848 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
849 let args.multiclick = 1
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
850 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
851 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
852 let args.button = 3
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
853 let args.multiclick = 0
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
854 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
855
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
856 " Shift click
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
857 let args = #{button: button, row: 3, col: 7, multiclick: 0, modifiers: 4}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
858 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
859 let args.button = 3
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
860 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
861
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
862 " Alt click
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
863 let args.button = button
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
864 let args.modifiers = 8
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
865 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
866 let args.button = 3
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
867 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
868
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
869 " Ctrl click
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
870 let args.button = button
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
871 let args.modifiers = 16
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
872 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
873 let args.button = 3
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
874 call test_mswin_event('mouse', args)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
875
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
876 call feedkeys("\<Esc>", 'Lx!')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
877 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
878
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
879 if has('gui_running')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
880 call assert_equal(['LeftMouse', 'LeftRelease', 'LeftMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
881 \ '2-LeftMouse', 'LeftMouse', '2-LeftMouse', '3-LeftMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
882 \ 'S-LeftMouse', 'A-LeftMouse', 'C-LeftMouse', 'MiddleMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
883 \ 'MiddleRelease', 'MiddleMouse', '2-MiddleMouse', 'MiddleMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
884 \ '2-MiddleMouse', '3-MiddleMouse', 'S-MiddleMouse', 'A-MiddleMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
885 \ 'C-MiddleMouse', 'RightMouse', 'RightRelease', 'RightMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
886 \ '2-RightMouse', 'RightMouse', '2-RightMouse', '3-RightMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
887 \ 'S-RightMouse', 'A-RightMouse', 'C-RightMouse'],
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
888 \ g:events)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
889 else
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
890 call assert_equal(['MiddleRelease', 'LeftMouse', '2-LeftMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
891 \ '3-LeftMouse', 'S-LeftMouse', 'MiddleMouse', '2-MiddleMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
892 \ '3-MiddleMouse', 'MiddleMouse', 'S-MiddleMouse', 'RightMouse',
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
893 \ '2-RightMouse', '3-RightMouse'],
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
894 \ g:events)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
895 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
896
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
897 for e in mouseEventCodes
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
898 exe 'nunmap ' .. e
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
899 endfor
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
900
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
901 bw!
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
902 call test_override('no_query_mouse', 0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
903 set mousemodel&
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
904 endfunc
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
905
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
906
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
907 " Test MS-Windows test_mswin_event error handling
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
908 func Test_mswin_event_error_handling()
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
909
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
910 let args = #{button: 0xfff, row: 2, col: 4, move: 0, multiclick: 0, modifiers: 0}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
911 if !has('gui_running')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
912 call assert_fails("call test_mswin_event('mouse', args)",'E475:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
913 endif
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
914 let args = #{button: 0, row: 2, col: 4, move: 0, multiclick: 0, modifiers: 0}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
915 call assert_fails("call test_mswin_event('a1b2c3', args)", 'E475:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
916 call assert_fails("call test_mswin_event(test_null_string(), {})", 'E475:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
917
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
918 call assert_fails("call test_mswin_event([], args)", 'E1174:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
919 call assert_fails("call test_mswin_event('abc', [])", 'E1206:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
920
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
921 call assert_false(test_mswin_event('mouse', test_null_dict()))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
922 let args = #{row: 2, col: 4, multiclick: 0, modifiers: 0}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
923 call assert_false(test_mswin_event('mouse', args))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
924 let args = #{button: 0, col: 4, multiclick: 0, modifiers: 0}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
925 call assert_false(test_mswin_event('mouse', args))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
926 let args = #{button: 0, row: 2, multiclick: 0, modifiers: 0}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
927 call assert_false(test_mswin_event('mouse', args))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
928 let args = #{button: 0, row: 2, col: 4, modifiers: 0}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
929 call assert_false(test_mswin_event('mouse', args))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
930 let args = #{button: 0, row: 2, col: 4, multiclick: 0}
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
931 call assert_false(test_mswin_event('mouse', args))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
932
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
933 call assert_false(test_mswin_event('key', test_null_dict()))
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
934 call assert_fails("call test_mswin_event('key', [])", 'E1206:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
935 call assert_fails("call test_mswin_event('key', {'event': 'keydown', 'keycode': 0x0})", 'E1291:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
936 call assert_fails("call test_mswin_event('key', {'event': 'keydown', 'keycode': [15]})", 'E745:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
937 call assert_fails("call test_mswin_event('key', {'event': 'keys', 'keycode': 0x41})", 'E475:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
938 call assert_fails("call test_mswin_event('key', {'keycode': 0x41})", 'E417:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
939 call assert_fails("call test_mswin_event('key', {'event': 'keydown'})", 'E1291:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
940
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
941 call assert_fails("sandbox call test_mswin_event('key', {'event': 'keydown', 'keycode': 61 })", 'E48:')
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
942
31628
238f424acc6c patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Bram Moolenaar <Bram@vim.org>
parents: 31559
diff changeset
943 " flush out anything in the typeahead buffer
31503
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
944 while getchar(0)
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
945 endwhile
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
946 endfunc
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
947
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
948
b9a4699d6a35 patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
949 " vim: shiftwidth=2 sts=2 expandtab