Just map them. Those keys don’t have the same ascii value in Mac, Linux and Windows. I don’t think their “ascii value” are even defined universally (and don’t let me get started to a discussion between ascii values and physical keys values).
But you can normally assume a code you get on an OS will be the same for the other installations of that OS. Just map/convert them to a table you define (e.g. the codes for one given OS).
I do avoid using function keys for my users. If possible, translate the needs to menu items and set a speed access control-letter, alt-letter, to them. This way you avoid weird mapped Fn-keys and codes, and make those functionalities more easily findable without needing to memorize.