Issues with ScanCode

I am having issues when I try to retrieve the scancode for a key pressed on my keyboard. I am using this code to dump out what key was pressed:

trace('convert: ${event.keyCode}');
trace('F1 keycode = ${KeyCode.F1}');
trace('charcode: ${event.charCode}');
trace('keycode: ${KeyCode.fromScanCode(ScanCode.F1)}');
trace('scancode: ${ScanCode.fromKeyCode(KeyCode.F1)}');
trace('keyboard code: ${Keyboard.F1}');
trace('ScanCode from keyboard code: ${ScanCode.fromKeyCode(event.keyCode)}');

What should have happened is the ScanCode returned for F1 should have been 58. Am I going about this wrong or is this a bug?

Do I just need to write my own key map?