On Fri Jul 29 02:37:46 2022 +0000, Zhiyi Zhang wrote:
For consistency, let's move hold_key() to the start of each test. Right now some of them are at the start and some are at the up.
I moved things around. So now the sequence is 1. flush() 2. comment describing the following test. 3. hold_key(), keydown, etc.
The other idea I had was to replace all the code with a structure and loop over that. Something like:
```c struct kbd_selection_sequence { BOOL hold_shift; BOOL hold_control; UINT press_key; int selected_count; const struct message *sequence; };
struct kbd_selection_sequence sequence[] = { /* Select multiple items via SHIFT+DOWN */ {1, 0, VK_DOWN, 2, ownerdata_multiselect_select_0_to_1_odstatechanged_seq}, /* Select one item via SHIFT+UP */ {1, 0, VK_UP, 1, ownerdata_multiselect_select_0_modkey_odstatechanged_seq}, /* ... */ };
for (i = 0; i < ARRAY_SIZE(sequence); i++) { if (sequence[i].hold_shift) hold_key(VK_SHIFT); /* ... */ } ```
Maybe that would make things a little easier to read and possibly even repurpose for non LVS_OWNERDATA listviews?