Shortcut for strikethrough when composing text?

AI-generated summary

Shortcut for strikethrough when composing text

The discussion revolves around finding a shortcut for strikethrough text in Discourse. donaldsoncd initiates the conversation, seeking a shortcut or a way to create one, as the manual process of typing ~~ around words is tedious.

Lilly suggests a theme component that adds a strikethrough composer button, but donaldsoncd prefers a shortcut. denvergeeks understands the request, and Canapin provides a potential solution by suggesting a file that could help in adding a shortcut to a component.

donaldsoncd confirms that a keyboard shortcut is the desired solution and expresses gratitude for the suggestions, although implementing code changes is not feasible.

Is there a shortcut for strikethrough (example) when composing text? Or a way to create one?

There is a shortcut for bolding and italics, but nothing for strikethrough. I need to manualy type ~~ around the word like this: ~~example~~.

In other places, the shortcut is Command + Shift + X but here in Discourse that changes the direction of the text window.

Hi @donaldsoncd :wave: A strike through composer button is part of this very useful theme component by @Steven :slight_smile:

Thank you for flagging this potential option, @Lilly! I’d prefer a shortcut for myself, but a button maybe be a good start for some of my forum’s users that don’t know the markdown convention.

An existing topic with other related info and methods:

also this is just a strike through button theme component by itself

https://github.com/MonDiscourse/discourse-strikethrough

@donaldsoncd I think I understand that what you are seeking is a way to create Keyboard Shortcuts such as Command + Shift + X to apply to other available standard formatting while writing in the composer?

Or perhaps being able to create your own collection of keyboard shortcuts specific to your Discourse site as a Theme Component would be neat.

Adding a shortcut to a component that adds a composer button may be possible.

Maybe this file could help?

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/d-editor.js#L65

(all Composer shortcuts start with Ctrl)

Yes, this is what I meant and would like more than a dedicated button at this time :slight_smile:

I’m not savvy enough to add anything via code, but thank you!