benblazak / ergodox-firmware

firmware for the ergoDOX keyboard
Other
595 stars 296 forks source link

How to use layers? #87

Open postelrich opened 7 years ago

postelrich commented 7 years ago

I'm trouble seeing how to switch layers. I've looked at keyboard--short-names but don't see anything regarding layer switching. What I'd like to do is have page up/down toggle layers. Any direction would be great.

benblazak commented 7 years ago

The keyboard--short-names file lists short names for the key codes defined in the USB spec. Layers are never sent to the host, so there's no key code for them. Instead, look at lib/key-functions/public/basic.c and at how the layer push pop functions are used in the layouts in the repo.