This is a proposed fix to this issue:
According to kbdcontrol(1)'s documentation, kbdcontrol(1) can be used to set function key strings for vt(4) and sc(4) console drivers. However, it seems that this hasn't been supported by the vt(4) driver, as function keys result in a call to terminal_input_special which gets teken's defined sequence to send for the function keys.
In this patch, vt(4) will behave the same as before if no function key is set using kbdcontrol(1), and it will send the function key's string if it has been set.