Add tests for event type reporting

This commit is contained in:
Kovid Goyal
2021-01-13 11:40:16 +05:30
parent 5498f4e526
commit 753ad68ca9
3 changed files with 26 additions and 12 deletions

View File

@@ -53,6 +53,7 @@ init_encoding_data(EncodingData *ans, const KeyEvent *ev) {
ans->has_mods = ev->mods.encoded[0] && ev->mods.encoded[0] != '1';
ans->add_alternates = ev->report_alternate_key && (ev->shifted_key > 0 || ev->alternate_key > 0);
if (ans->add_alternates) { ans->shifted_key = ev->shifted_key; ans->alternate_key = ev->alternate_key; }
ans->action = ev->action;
ans->key = ev->key;
memcpy(ans->encoded_mods, ev->mods.encoded, sizeof(ans->encoded_mods));
}