Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of key commands #7

Closed
Kapeli opened this issue Mar 5, 2014 · 4 comments
Closed

Order of key commands #7

Kapeli opened this issue Mar 5, 2014 · 4 comments

Comments

@Kapeli
Copy link
Owner

Kapeli commented Mar 5, 2014

As @jk pointed out at b3db6f1#commitcomment-5570430, the Apple order for modifier keys is ⌃⌥⇧⌘X. Cheat sheets should follow the same order.

@Kapeli
Copy link
Owner Author

Kapeli commented Mar 5, 2014

My reasoning to not follow Apple's order was that because we're not listing the key commands using symbols, we should list them in a different order based on how users would read them from left to right.

Apple does the same thing at http://support.apple.com/kb/ht1343, where their order is the reverse of ⌃⌥⇧⌘X.

That's my reasoning, but I definitely have no idea what I'm doing here and this is definitely open for debate.

@jk
Copy link
Contributor

jk commented Mar 5, 2014

Apple does the same thing at http://support.apple.com/kb/ht1343, where their order is the reverse of ⌃⌥⇧⌘X.

You do have a point here. But when in doubt, I think, the actual implementation dominates its documentation.

I would prefer a visually more appealing style, like showing the keys. I experimented with transforming the command directive into its idioms, but the result is really fugly (it's just too small):

Screenshot of a cheat sheet from Dash

Then I remebered that StackOverflow does a similar thing. They use the <kbd>…</kbd> HTML tag with custom CSS styling:

kbd {
    padding: 0.1em 0.6em;
    border: 1px solid #ccc;
    font-size: 11px;
    font-family: Arial,Helvetica,sans-serif;
    background-color: #f7f7f7;
    color: #333;
    -moz-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
    -webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
    box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
    border-radius: 3px;
    display: inline-block;
    margin: 0 0.1em;
    text-shadow: 0 1px 0 #fff;
    line-height: 1.4;
    white-space: nowrap;
}

I think we can combine the best of both worlds. Writing command = 'Cmd+Alt+X' into the .rb file and let a parser transform that into:

<span title="Command + Option + X">
    <kbd></kbd>
    <kbd></kbd>
    <kbd>X</kbd>
</span>

so hovering over the shortcut will reveal its textual representation. It has the advantage that the shortcut will not take so much space while displaying / printing it. Even more than one shortcut, separated by commas can be transformed.

@Kapeli
Copy link
Owner Author

Kapeli commented Mar 5, 2014

That's a great idea! I'll try to implement that today, although I think it's beyond my Ruby skills.

One problem I can think of is that 'command' entries are also used for non-keyboard shortcut stuff (e.g. see RegEx cheatsheet). I think I'll have to introduce a separate 'shortcut' entry.

@damomurf
Copy link

At the risk of turning this into something huge, there are other keys that would be handy to include in cheat sheets, as per: http://www.danrodney.com/mac/index.html (under Menu Symbols)

@Kapeli Kapeli closed this as completed May 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants