summaryrefslogtreecommitdiff
path: root/tests/test_common/test_keymap_key.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_common/test_keymap_key.hpp')
-rw-r--r--tests/test_common/test_keymap_key.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/test_common/test_keymap_key.hpp b/tests/test_common/test_keymap_key.hpp
index 7861cb4a32..37b4c827e4 100644
--- a/tests/test_common/test_keymap_key.hpp
+++ b/tests/test_common/test_keymap_key.hpp
@@ -16,6 +16,9 @@
#pragma once
+#include <cstddef>
+#include <string>
+#include "keycode_util.hpp"
extern "C" {
#include "keyboard.h"
#include "test_matrix.h"
@@ -26,8 +29,13 @@ extern "C" {
typedef uint8_t layer_t;
struct KeymapKey {
- KeymapKey(layer_t layer, uint8_t col, uint8_t row, uint16_t keycode) : layer(layer), position({.col = col, .row = row}), code(keycode), report_code(keycode) { validate(); }
- KeymapKey(layer_t layer, uint8_t col, uint8_t row, uint16_t keycode, uint16_t report_code) : layer(layer), position({.col = col, .row = row}), code(keycode), report_code(report_code) { validate(); }
+ KeymapKey(layer_t layer, uint8_t col, uint8_t row, uint16_t keycode) : layer(layer), position({.col = col, .row = row}), code(keycode), report_code(keycode), name(get_keycode_identifier_or_default(keycode)) {
+ validate();
+ }
+
+ KeymapKey(layer_t layer, uint8_t col, uint8_t row, uint16_t keycode, uint16_t report_code) : layer(layer), position({.col = col, .row = row}), code(keycode), report_code(report_code), name{get_keycode_identifier_or_default(keycode)} {
+ validate();
+ }
void press();
void release();
@@ -35,6 +43,7 @@ struct KeymapKey {
const layer_t layer;
const keypos_t position;
const uint16_t code;
+ std::string name;
/* Sometimes the keycode does not match the code that is send in the usb report, so we provide it here. */
const uint16_t report_code;
@@ -43,4 +52,5 @@ struct KeymapKey {
assert(position.col <= MATRIX_COLS);
assert(position.row <= MATRIX_ROWS);
}
-}; \ No newline at end of file
+ uint32_t timestamp_pressed;
+};