import '../core/String';  // For String#capitalise
import UA from '../ua/UA';

const isMac = UA.isMac;
const platformKeys = {
    Alt: isMac ? '⌥' : 'Alt-',
    Cmd: isMac ? '⌘' : 'Ctrl-',
    Meta: isMac ? '⌘' : 'Meta-',
    Shift: isMac ? '⇧' : 'Shift-',
    Escape: 'Esc',
    Enter: isMac ? '↵' : 'Enter',
    Backspace: isMac ? '⌫' : 'Backspace',
};

/**
    Function: O.formatKeyForPlatform

    Parameters:
        shortcut - {String} The keyboard shorcut, in the same format as
                   taken by <O.GlobalKeyboardShortcuts#register>.

    Returns:
        {String} The shortcut formatted for display on the user's platform.
*/
export default function formatKeyForPlatform ( shortcut ) {
    return shortcut.split( '-' ).map(
        key => platformKeys[ key ] || key.capitalise()
    ).join( '' );
}

@@ -119,16 +119,96 @@
 eys = %7B%0A
+    ArrowUp: '%E2%86%91',%0A    ArrowDown: '%E2%86%93',%0A    ArrowRight: '%E2%86%92',%0A    ArrowLeft:  '%E2%86%90',%0A
     Alt:

Add arrow keys to formatKeyForPlatform fn