Skip to content

Keyboard Shortcuts #9

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

Closed
3 tasks done
matthojo opened this issue May 7, 2013 · 17 comments · Fixed by #298
Closed
3 tasks done

Keyboard Shortcuts #9

matthojo opened this issue May 7, 2013 · 17 comments · Fixed by #298
Milestone

Comments

@matthojo
Copy link
Contributor

matthojo commented May 7, 2013

The Ghost editor should have a number of keyboard shortcuts to assist with writing tasks.

A good example of how this works can be seen in the Mou app, under the Actions menu. We need to research, when applying this to a browser based app: What are the keyboard shortcuts available to us that won't cause major conflicts with OS+browser native shortcuts? See also: List of common shortcuts - wikipedia

Proposed shortcuts:

  • Zen Writing (fullscreen) Mode (Currently: Ctrl+Shift+Z)
    • TODO: Toggle off when shortcut is repeated
    • TODO: Toggle off when escape key is pressed
  • Text formatting shortcuts (see Mou)
  • Publishing action shortcuts (to change values of the publish button)
@ghost ghost assigned JohnONolan May 7, 2013
@ghost ghost assigned matthojo May 19, 2013
@JohnONolan
Copy link
Member

Updated this to be the main issue for keyboard shortcuts - this needs lots of research about what shortcuts we can safely use (Cross-browser) and what actions we can perform on our Markdown using the CodeMirror API.

I would suggest that we try to replicate as many of the Mou formatting shortcuts as we can, to begin with, and see how it goes.

@matthojo
Copy link
Contributor Author

Fo reference this is the Mou shortcuts;

Actions

  • Copy HTML: Option + Cmd + C
  • Strong: Select text, Cmd + B
  • Emphasize: Select text, Cmd + I
  • Inline Code: Select text, Cmd + K / Ctrl+Shift+K (Ctrl+K is reserved)
  • Strikethrough: Select text, Cmd + U Ctrl+Alt+U
  • Link: Select text, Control + Shift + L
  • Image: Select text, Control + Shift + I
  • Select Word: Control + Option + W
  • Select Line: Shift + Cmd + L
  • Select All: Cmd + A
  • Deselect All: Cmd + D
  • Convert to Uppercase: Select text, Control + U
  • Convert to Lowercase: Select text, Control + Shift + U
  • Convert to Titlecase: Select text, Control + Option + Shift + U
  • Convert to List: Select lines, Control + L
  • Convert to Blockquote: Select lines, Control + Q
  • Convert to H1: Cmd + 1 Alt+1
  • Convert to H2: Cmd + 2 Alt+2
  • Convert to H3: Cmd + 3 Alt+3
  • Convert to H4: Cmd + 4 Alt+4
  • Convert to H5: Cmd + 5 Alt+5
  • Convert to H6: Cmd + 6 Alt+6
  • Convert Spaces to Tabs: Control + [
  • Convert Tabs to Spaces: Control + ]
  • Insert Current Date: Control + Shift + 1
  • Insert Current Time: Control + Shift + 2
  • Insert entity <: Control + Shift + ,
  • Insert entity >: Control + Shift + .
  • Insert entity &: Control + Shift + 7
  • Insert entity Space: Control + Shift + Space
  • Insert Scriptogr.am Header: Control + Shift + G
  • Shift Line Left: Select lines, Cmd + [
  • Shift Line Right: Select lines, Cmd + ]
  • New Line: Cmd + Return
  • Comment: Cmd + /
  • Hard Linebreak: Control + Return

*If Cmd is specified, for Windows replace with Ctrl.

@matthojo
Copy link
Contributor Author

matthojo commented Jun 9, 2013

I'll add Publishing action shortcuts in tomorrow to get this done.

@ErisDS
Copy link
Member

ErisDS commented Jun 9, 2013

Btw, the alt + 3 shortcut conflicts with making a hash on my macbook air. I thought alt+3 was the hash key on most macs (there's never a key like on normal keyboards).. this is incredibly confusing because every time I want to add a hash, I get 3 :(

@matthojo
Copy link
Contributor Author

matthojo commented Jun 9, 2013

'tis true! Sorry about that. I'll change the shortcut to something more fitting, maybe Ctrl+Alt+number?

@JohnONolan
Copy link
Member

maybe Ctrl+Alt+number?

👍

@matthojo
Copy link
Contributor Author

Can this be closed?

@JohnONolan
Copy link
Member

Definitely not - far from done. One thing I just noticed - adding a link via keyboard shortcut:

  • Select word to turn into link
  • Press Ctrl+Shft+L
  • Turns into word

Expected behaviour: http:// is highlighted, so I can paste in my URL if I've got one ready (just like Mou)

Actual behaviour: the whole [word](http://) is highlighted.

@ErisDS
Copy link
Member

ErisDS commented Jul 14, 2013

Marking this as top priority as I think we need to ensure that we can do what we need to do with the current CodeMirror setup. If we can't this will act as an early warning that we need better (our own) tools.

@matthojo
Copy link
Contributor Author

Does this issue need any more shortcuts adding @JohnONolan?

@JohnONolan
Copy link
Member

Looks very good. Is there any way we can do the very first thing on the list? Copy/export HTML? I think it should be possible :)

@matthojo
Copy link
Contributor Author

It is possible but to safely copy stuff to the clipboard you'd need Flash.

@JohnONolan
Copy link
Member

Good point - can you have a look into this and report back on what the overhead and implications would be?

@JohnONolan
Copy link
Member

Overhead and implications = filesize, pageload time, translation issues, compatibility with other components, implementation requirements, etc.

@matthojo
Copy link
Contributor Author

Ok digging a little further, Github now uses (which seems the best option);

This implementation problem with requiring a button will keep occurring, because Flash doesn't allow you to copy something to the clipboard unless it is focused (which we cant do) or unless it's clicked (the button).

@JohnONolan
Copy link
Member

Roger that - any less reliable (progressive enhancement?) alternatives to using flash? HTML5 API or anything that we can make use of?

@matthojo
Copy link
Contributor Author

Added rough implementation of Copy to HTML. (waiting on modals)

tegud pushed a commit to tegud/Ghost that referenced this issue Feb 24, 2014
@matthojo matthojo removed their assignment Mar 20, 2014
@hswolff hswolff mentioned this issue Mar 20, 2014
9 tasks
ErisDS pushed a commit that referenced this issue Aug 28, 2014
fixes #8, #9, #10, #11
- Add Gemfile
- Swap normalize.css with normalize-scss
- Add grunt-contrib-sass task to compile sass
- Ignore .sass-cache
ErisDS pushed a commit that referenced this issue Aug 30, 2014
fixes #8, #9, #10, #11
- Add Gemfile
- Swap normalize.css with normalize-scss
- Add grunt-contrib-sass task to compile sass
- Ignore .sass-cache
ErisDS pushed a commit that referenced this issue Aug 30, 2014
fixes #8, #9, #10, #11
- Add Gemfile
- Swap normalize.css with normalize-scss
- Add grunt-contrib-sass task to compile sass
- Ignore .sass-cache
daniellockyer pushed a commit that referenced this issue Jul 20, 2022
mhinz-blogs pushed a commit to mhinz-blogs/Ghost that referenced this issue May 18, 2024
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

Successfully merging a pull request may close this issue.

3 participants