Remapping the keys for bold character

The default keys to enter bold characters is F6 F5. I am finding it very tedius to constantly hitting these two keys. I am considering mapping this to something much more convenient like bb when in math mode.

Inside the file prefix-kbd.scm, I found the following:

(kbd-map
  (:mode in-math?)
  ("math:bold:up" "" "Insert an upright bold character")
)

I tried to add map this to bb, but it didn’t work.

(kbd-map
  (:mode in-math?)
  ("b b"   ("math:bold:up" "" "Insert an upright bold character"))
)

It is possible to use (make 'math-bf) but this puts me in the mode where whatever I type is in bold, instead of just inserting a bold character, which is what I am looking for.

Does anyone know how I can map the functionality provided by F6 F5 to bb ?

I looked in that file and I found

(kbd-wildcards pre
("math:bold:up" "math:bold math:up" #t))

in a larger kbd-wildcards command.
I understand it in this way (with the help of guessing): this is not a keyboard remapping but a name substitution for remapping—so that when kbd-map encounters math:bold:up it remaps the keys associated with it to the new meaning (let me know if this explanation makes sense).

In math/math-kbd.scm you then find the whole remapping of the keyboard, based on math:bold:up, e.g.

("math:bold:up a" "<b-up-a>")

inside a kbd-map with the condition that one is in math mode.
Given this, I think that you need to remap the whole alphabet:

("b b a" "<b-up-a>")

and so on.

I haven’t been able to reassign the keys to math:bold:up, nevertheless the whole mapping is independent from this—I tested only "b b a"; I expect that all the letters will work.

Thanks. This seems very impractical because I would have to do all small, capital, greek letters, etc. Surely, it should be possible to emulate with b b, the key press F6 F5 so that I don’t have to define all the alphabet in my code.

Since the kbd-mapping of the alphabet is already written up in math/math-kbd.scm, you may copy-paste it, then replace the occurrences of math:bold:up with a key combination of your choice.
Maybe someone else will tell you how to reassign math:bold:up.

I did not try changing the assignment inside prefix-kbd.scm because it is bad practice.

I think I found out one part of the answer by looking at the C++ code and guessing. Once that you execute

(kbd-wildcards pre ("math:bold:up" "b b" #t))

you then need to redo the keymap of "math:bold:up" with kbd-map, as the substitution of "b b" for "math:bold:up" is done when binding the keys, not when typing.

I tried and did the assignment of "math:bold:up" in the personal initialization file to check if it would work there (maybe math/math-kbd.scm is run later, when one enters math mode for the first time), but it did not work.

My understanding of this moment is that you need to redo all of the key bindings.