aboutsummaryrefslogtreecommitdiff
path: root/tests/test_common/keyboard_report_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_common/keyboard_report_util.cpp')
-rw-r--r--tests/test_common/keyboard_report_util.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/test_common/keyboard_report_util.cpp b/tests/test_common/keyboard_report_util.cpp
index e148c76be..f73cf239e 100644
--- a/tests/test_common/keyboard_report_util.cpp
+++ b/tests/test_common/keyboard_report_util.cpp
@@ -44,21 +44,16 @@ bool operator==(const report_keyboard_t& lhs, const report_keyboard_t& rhs) {
44 return lhs.mods == rhs.mods && lhskeys == rhskeys; 44 return lhs.mods == rhs.mods && lhskeys == rhskeys;
45} 45}
46 46
47std::ostream& operator<<(std::ostream& stream, const report_keyboard_t& report) { 47std::ostream& operator<<(std::ostream& stream, const report_keyboard_t& value) {
48 auto keys = get_keys(report); 48 stream << "Keyboard report:" << std::endl;
49 49 stream << "Mods: " << (uint32_t)value.mods << std::endl;
50 stream << "Keys: ";
50 // TODO: This should probably print friendly names for the keys 51 // TODO: This should probably print friendly names for the keys
51 stream << "Keyboard Report: Mods (" << (uint32_t)report.mods << ") Keys ("; 52 for (uint32_t k : get_keys(value)) {
52 53 stream << k << " ";
53 for (auto key = keys.cbegin(); key != keys.cend();) {
54 stream << +(*key);
55 key++;
56 if (key != keys.cend()) {
57 stream << ",";
58 }
59 } 54 }
60 55 stream << std::endl;
61 return stream << ")" << std::endl; 56 return stream;
62} 57}
63 58
64KeyboardReportMatcher::KeyboardReportMatcher(const std::vector<uint8_t>& keys) { 59KeyboardReportMatcher::KeyboardReportMatcher(const std::vector<uint8_t>& keys) {