Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some use of keymap.h #19980

Merged
merged 2 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/python/qmk/cli/generate/keycodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def generate_keycode_extras(cli):
"""

# Build the header file.
keycodes_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '#include "keymap.h"', '// clang-format off']
keycodes_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '#include "keycodes.h"', '// clang-format off']

keycodes = load_spec(cli.args.version, cli.args.lang)

Expand Down
3 changes: 1 addition & 2 deletions quantum/keymap.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#include "quantum_keycodes.h"

// translates key to keycode
uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key);
#include "keymap_common.h"

#ifdef ENCODER_MAP_ENABLE
// Ensure we have a forward declaration for the encoder map
Expand Down
7 changes: 7 additions & 0 deletions quantum/keymap_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

// translates key to keycode
uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key);
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_belgian.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_bepo.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_brazilian_abnt2.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_canadian_multilingual.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_colemak.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_croatian.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_czech.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_danish.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_dvorak.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_dvorak_fr.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_dvorak_programmer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_estonian.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_finnish.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_french.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_french_afnor.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_french_mac_iso.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_german.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_german_mac_iso.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_greek.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_hebrew.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_hungarian.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_icelandic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_irish.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_italian.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_italian_mac_ansi.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_italian_mac_iso.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_japanese.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_korean.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_latvian.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_lithuanian_azerty.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_lithuanian_qwerty.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_neo2.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_nordic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_norman.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_norwegian.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_plover.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_plover_dvorak.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_polish.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_portuguese.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_portuguese_mac_iso.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_extras/keymap_romanian.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*******************************************************************************/

#pragma once
#include "keymap.h"
#include "keycodes.h"
// clang-format off

// Aliases
Expand Down
Loading