Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Keyboard function key mappings
Author | Message | ||||
trippyben Regular Member Joined: 26/06/2011 Location: AustraliaPosts: 91 |
Has anyone tried to read the function key mappings as detailed in the user manual under Keyboard? "Standard IBM compatible PS2 keyboard with mini-DIN connector or a USB/mini-DIN adapter. Non ASCII keys (such as the function keys) are mapped to ASCII characters. Use a command like PRINT HEX$(VAL(INKEY$)) to check the actual mapping." I find that the arrows, page up and down etc are mapped to their matching numeric key on the numeric keypad, but can't get a useful response for the F1 and so on keys. Does this mean those keys are not mapped by the Maxi firmware? Ben |
||||
James_From_Canb Senior Member Joined: 19/06/2011 Location: AustraliaPosts: 265 |
I haven't tried - but might it be returning 2 values? There's a table in this link called IBM scan codes which seems to say that F1 is decimal 00 followed by decimal 59. James My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention. Hedley Lamarr, Blazing Saddles (1974) |
||||
trippyben Regular Member Joined: 26/06/2011 Location: AustraliaPosts: 91 |
Never mind, if found the way to do it (Thanks to some code gerard wrote for sparkey) You need to use PRINT HEX$(ASC(INKEY$)) to check the actual mapping!! Ben |
||||
trippyben Regular Member Joined: 26/06/2011 Location: AustraliaPosts: 91 |
Thanks James, I'm sure that's what the keyboard is spitting out - it was more how the maximite presents the value that was required. |
||||
Jimbo Newbie Joined: 20/06/2011 Location: AustraliaPosts: 8 |
The standard firmware maps the Function keys to characters with ASCII code: F1 = 0x0e F2 = 0x0f F3 = 0x10 F4 = 0x11 F5 = 0x12 F6 = 0x13 F8 = 0x15 F9 = 0x16 F10 = 0x17 F11 = 0x18 F12 = 0x19 F7 is Defined as return 0x14, but in fact due to its SCAN code number being higher than most, is not detected correctly, and returned as F5 (So pressing F7) will always be reported as F5 and return 0x12. This is only true for the Keyboard pluged into the mini-DIN port. Terminal programs sending characters via the USB serial will most likly expand these keys to one or more key presses before sending over the wire. The standard firmware Doesn't support the IBM Extended Scan Codes. So keys like insert, delete, pgup, pgdn, home, end, and The standalone arrow keys, and the Numeric Keypad ENTER are not detected. They are easly added (see my attached updated keyboard.c file), however the trick is having a standard ASCII value to map them to. I chose to map mine according to http://classicteck.com/maxdev/ascii.html but there may be other standards. Modified V2.5 Keyboard.c file to detect and map extended key scan codes. 2011-08-01_210053_Keyboard.zip |
||||
Print this page |