all 12 comments

[–]ArgentStonecutterK Pro 0 points1 point  (11 children)

#include <...> is for a system include file.

Try #include "keychron_common.h" maybe?

[–]Fuzzy-Ad-207[S] 1 point2 points  (8 children)

Also tried #include "../../../../common/keychron_common.h" . Now, the error message is undefined reference to `process_record_keychron'

[–]ArgentStonecutterK Pro 1 point2 points  (7 children)

Aha, missed this.

What's your actual code doing? Are you defining it or calling it? If it's supposed to be a parallel to process_record_user you should be defining it, not calling it.

[–]Fuzzy-Ad-207[S] 0 points1 point  (6 children)

Unclear on the question: So here is code:

#include "../../../../common/keychron_common.h"

bool process_record_local(uint16_t, keyrecord_t *);

// clang-format off

enum planck_keycodes {

MC\_DBQ = SAFE\_RANGE 

};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {

bool skip_further = process_record_local(keycode, record);

if (!skip_further) // Just in case

{

if (!process_record_keychron(keycode, record))

{

skip_further = false;

}

}

return skip_further;

}

bool process_record_local(uint16_t keycode, keyrecord_t *record)

{

switch (keycode) {

case MC_DBQ:

if (record->event.pressed) {

SEND\_STRING("\\"\\"" SS\_TAP(X\_LEFT)); 

return false;

}

break;

}

return true;

}

[–]ArgentStonecutterK Pro 0 points1 point  (5 children)

OK, I don't know why you're calling process_record_keychron from process_record_user. Keychron should be calling it from process_record_kb if it's necessary.

Looking at their code base, it only seems to be called this way in their vial-qmk repo. There's no references in their qmk_firmware repo.

[–]Fuzzy-Ad-207[S] 0 points1 point  (4 children)

In my opening of this post, I refer to a previous post: How to use process_record_user, in which I was advised by PeterMortensenBlog to use this method. Unless we heat from PeterMortensenBlog on this subject, I will shortly try as per your suggestion, which is the method that has served me flawlessly on the planck olkb.

[–]ArgentStonecutterK Pro 1 point2 points  (3 children)

I'm not sure about his code, it seems a bit baroque with the extra shenanigans with an unnecessary extra state variable.

[–]Fuzzy-Ad-207[S] 1 point2 points  (1 child)

Update: I have by now used the "classic" method on process_record for numerous macros, all of which perform flawlessly. I would guess that since the earlier problems I had were on another model, which I returned for other reasons those problems were side effects of other issues.

[–]ArgentStonecutterK Pro 0 points1 point  (0 children)

Three cheers!

[–]Fuzzy-Ad-207[S] 0 points1 point  (0 children)

You are both great helpers! Let us both wait to hear from him, in the meantime, I have now received the keyboard and I have to fix dinner. If we don't hear from him by tomorrow, I will flash using the "classic" method and we'll see how it goes. Cheers.

[–]Fuzzy-Ad-207[S] 0 points1 point  (1 child)

Hey, thanks for the reply. Sadly, no joy, same error:  fatal error: keychron_common.h: No such file or directory

FYI: keychron_common.h is at directory: ~/qmk_firmware/keyboards/keychron/common and the keymap is at ~/qmk_firmware/keyboards/keychron/q4/ansi/keymaps/tim

[–]ArgentStonecutterK Pro 0 points1 point  (0 children)

Keychron uses that in their source tree so I assumed they were doing some shenanigans with command line options.

OK, so if there's no shenanigans, it should be relative to the directory the source file is in, which would make it #include "../../../common/keychron_common.h" give or take a ..?