mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-09-07 19:02:35 +02:00
keycode_string review revisions.
* Rename keycode_string() -> get_keycode_string() for consistency with existing string utils like get_u8_str(). * Revise custom keycode names with separate _user and _kb tables.
This commit is contained in:
@@ -22,8 +22,11 @@ enum {
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
extern "C" const keycode_string_name_t custom_keycode_names[] = {
|
||||
extern "C" const keycode_string_name_t keycode_string_names_kb[] = {
|
||||
KEYCODE_STRING_NAME(MYMACRO1),
|
||||
KEYCODE_STRING_NAMES_END // End of table sentinel.
|
||||
};
|
||||
extern "C" const keycode_string_name_t keycode_string_names_user[] = {
|
||||
KEYCODE_STRING_NAME(MYMACRO2),
|
||||
KEYCODE_STRING_NAME(KC_EXLM),
|
||||
KEYCODE_STRING_NAMES_END // End of table sentinel.
|
||||
@@ -32,7 +35,7 @@ extern "C" const keycode_string_name_t custom_keycode_names[] = {
|
||||
|
||||
class KeycodeStringTest : public TestFixture {};
|
||||
|
||||
TEST_F(KeycodeStringTest, keycode_string) {
|
||||
TEST_F(KeycodeStringTest, get_keycode_string) {
|
||||
struct TestParams {
|
||||
uint16_t keycode;
|
||||
std::string expected;
|
||||
@@ -98,6 +101,6 @@ TEST_F(KeycodeStringTest, keycode_string) {
|
||||
{MYMACRO2, "MYMACRO2"},
|
||||
{KC_EXLM, "KC_EXLM"},
|
||||
})) {
|
||||
EXPECT_EQ(keycode_string(keycode), expected) << "where keycode = 0x" << std::hex << keycode;
|
||||
EXPECT_EQ(get_keycode_string(keycode), expected) << "where keycode = 0x" << std::hex << keycode;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user