tmk / tmk_keyboard

Keyboard firmwares for Atmel AVR and Cortex-M
3.98k stars 1.7k forks source link

How to use macros with UNIMAP/ACTIONMAP, please? #404

Closed DreymaR closed 7 years ago

DreymaR commented 7 years ago

So, I've almost succeeded in making Unimap work for me, but...

I tried this, similar to what worked for me with USB-USB KEYMAP_ALL: # define AC_FN9 ACTION_MACRO(TYPESTR1) // FN9 is a user macro: Type a string

Nope. The compiler gives an error: TYPESTR1 undeclared here (not in a function)

Is it because the macros used to be defined before the FN keys and now the FN keys are defined first? Or, how do I implement a macro properly with UNIMAP please?

tmk commented 7 years ago

You have to provide macro IDs before macro definition. See this file for example.

https://github.com/tmk/tmk_keyboard/blob/093bfd6901d6153f4c3bc03d38c1bae8717065e8/keyboard/hhkb/unimap_hasu.c

DreymaR commented 7 years ago

OK, thanks! It works now.

It'd be nice if the unimap files could be in some other directory, common for all architectures. That's part of the idea with unimap, right? :-)