AAMfP,
@AAMfP@fosstodon.org avatar

Question for all you and lovers out there: the ErgoDash default layout has a couple of C functions in the keymap file. Do I need (to keep) them?

I'm playing with my keymap for the first time, while waiting for my ErgoDash to arrive.
I've created a few layers and everything compiles. ✌🏻
I don't want to brick the as soon as it arrives, so I was trying to understand what those functions are for.

Help?

ajwk,

@AAMfP Assuming you are talking about ‘persistent_default_layer_set’ and ‘process_record user’ in https://github.com/qmk/qmk_firmware/blob/master/keyboards/omkbd/ergodash/rev1/keymaps/default/keymap.c, they are providing the implementation for the keymap’s custom keycodes QWERTY, LOWER, RAISE, and ADJUST. If you don’t want to use those keycodes in your keymap, then you don't need those functions.

AAMfP,
@AAMfP@fosstodon.org avatar

@ajwk
I actually was thinking to rename those keycodes a bit differently (QWERTY, RIGHT, LEFT, MOUSE, and MODDH), but, if I properly understood, if I use, say, MO(1) instead of MO(RIGHT) to activate a layer, everything should work fine, right?

ajwk,

@AAMfP The argument to MO() is a layer number, not a keycode. Notice that the default/keymap.c defines two enums at the top: one for the layers, and one for the custom keycodes (starting from SAFE_RANGE). But yes, you can just use MO with your own layer numbers in your keymap, and skip all the tri-layer stuff that the default keymap does with its custom keycodes.

AAMfP,
@AAMfP@fosstodon.org avatar

@ajwk
Thanks! Clear!

ajwk,

@AAMfP Correction: ‘persistent_default_layer_set’ does not appear to be used at all. The ‘process_record_user’ function is using ‘set_single_persistent_default_layer’ (a function provided by QMK’s quantum.c) instead.

ajwk,

@AAMfP A keymap does not have to provide a ‘process_record_user' function, but if it does, that is how it hooks into the processing of individual keypresses: https://docs.qmk.fm/#/custom_quantum_functions?id=programming-the-behavior-of-any-keycode

AAMfP,
@AAMfP@fosstodon.org avatar

@ajwk
Thanks!

semiconductor,

@AAMfP
Not 100% sure, but if you don't know what they are and they don't take too much on board memory then leave the functions. I do think though if you can figure out what purpose they have and you don't need them then you're safe to remove the lines of code. Just keep a back up of the original code just in case!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • mechanicalkeyboards
  • DreamBathrooms
  • thenastyranch
  • ngwrru68w68
  • magazineikmin
  • khanakhh
  • rosin
  • mdbf
  • Youngstown
  • slotface
  • everett
  • cisconetworking
  • kavyap
  • tacticalgear
  • InstantRegret
  • JUstTest
  • Durango
  • osvaldo12
  • ethstaker
  • modclub
  • GTA5RPClips
  • Leos
  • cubers
  • tester
  • normalnudes
  • megavids
  • provamag3
  • anitta
  • lostlight
  • All magazines