Attempt at simplifying interface.

This commit is contained in:
Pascal Getreuer
2025-01-21 23:55:16 -08:00
parent 45f573f335
commit 8eaf67de76
10 changed files with 152 additions and 45 deletions
+4
View File
@@ -17,3 +17,7 @@
#pragma once
#include "test_common.h"
#define KEYCODE_STRING_NAMES_USER
#define KEYCODE_STRING_NAMES_KB
+1
View File
@@ -15,3 +15,4 @@
KEYCODE_STRING_ENABLE = yes
EXTRAKEY_ENABLE = yes
MOUSEKEY_ENABLE = yes
INTROSPECTION_KEYMAP_C = test_keymap.c
+1 -17
View File
@@ -15,23 +15,7 @@
#include <iostream>
#include "test_common.hpp"
enum {
MYMACRO1 = SAFE_RANGE,
MYMACRO2,
};
// clang-format off
extern "C" const keycode_string_name_t *keycode_string_names_kb = (keycode_string_name_t []){
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_t []){
KEYCODE_STRING_NAME(MYMACRO2),
KEYCODE_STRING_NAME(KC_EXLM),
KEYCODE_STRING_NAMES_END // End of table sentinel.
};
// clang-format on
#include "test_keymap.h"
class KeycodeStringTest : public TestFixture {};
+27
View File
@@ -0,0 +1,27 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "test_keymap.h"
#include "quantum.h"
// clang-format off
const keycode_string_name_t keycode_string_names_kb[] = {
KEYCODE_STRING_NAME(MYMACRO1),
};
const keycode_string_name_t keycode_string_names_user[] = {
KEYCODE_STRING_NAME(MYMACRO2),
KEYCODE_STRING_NAME(KC_EXLM),
};
// clang-format on
+20
View File
@@ -0,0 +1,20 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
enum {
MYMACRO1 = SAFE_RANGE,
MYMACRO2,
};