Hi wolfv,
I'm going to assume that the keyboard handles this, and without thinking too hard about the best way it would do it, I'll just throw out some human-readable pseudo code:
// (inside some kind of input checking loop or function)
if function_layer_key then
...
if key_you_press then
send( shift_key_press)
send( whatever_key_press)
end
...
end
Basically, my feeling is that while the keyboard (teensy in your case) is scanning the matrix to see what is being pressed, it does a compare against the function layer key, and if that is pressed, it just sends a different (or combination of) key press signal(s) to the computer.