# Is there any way to copy the code?

**URL:** https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608
**Category:** Site Feedback
**Created:** [March 25, 2019, 2:25pm UTC](https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608 "2019-03-25T14:25:41Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![janglee](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/janglee/32/4035_2.png) [@janglee](https://discourse.processing.org/u/janglee)
#### Post date: [March 25, 2019, 2:25pm UTC](https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608/1 "2019-03-25T14:25:41Z")

</div>

It is hard to only select the code and copy big ones from a post. If not I suggest adding a button (since we allow pasting the code here) to copy the whole code at a click. A helpful [link](https://meta.discourse.org/t/copy-option-for-code-blocks-in-discourse/60961).

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [March 25, 2019, 3:25pm UTC](https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608/2 "2019-03-25T15:25:49Z")

</div>

but if you do it on a daily basis you find your way, like:

- mouse drag down ( select) over the first line of code
- walk down to the end of the code
- press/hold [Shift] and click after the last “}”

so the whole code is selected

- press [Ctrl][c] for copy

but yes, that copy to clipboard is wanted,  
same as that the OP use the code block: [\</\>] Preformatted Text for their code  
– and not PASTE as text  
– or even more bad, use the ["] Blockquote what is damaging the code.

---

<div class="post-metadata">

### Author: ![janglee](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/janglee/32/4035_2.png) [@janglee](https://discourse.processing.org/u/janglee)
#### Post date: [March 25, 2019, 4:16pm UTC](https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608/3 "2019-03-25T16:16:47Z")

</div>

> [@kll](#):
>
> - mouse drag down ( select) over the first line of code
> - walk down to the end of the code
> - press/hold [Shift] and click after the last “}”

Yo, I sometimes use this trick.

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [March 25, 2019, 9:52pm UTC](https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608/4 "2019-03-25T21:52:09Z")

</div>

> [@kll](#):
>
> press/hold [Shift] and click after the last “}”

Never did that before! I merely create a mouse rectangular selection of the whole code block. 😸

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [March 26, 2019, 2:00am UTC](https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608/5 "2019-03-26T02:00:52Z")

</div>

that’s what we talk about here:  
the usual mouse click / drag down / release  
what you call “mouse rectangular selection”  
sometimes with long code ( OS / Browser dependent ) just does not work,  
( or i should buy a new mouse?? )

i can try downwards, upwards… only catch a piece

in that situation the [Shift]click trick helps

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [March 26, 2019, 2:38am UTC](https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608/6 "2019-03-26T02:38:12Z")

</div>

- 1st I click & hold at the left-top corner of the block code.
- Then I move the mouse to the far right side.
- After that I move the mouse farther down, completing a rectangle.
- Then a scroll down automatically starts.
- I just need to maintain the mouse at the right-bottom until the whole code is selected.

---

<div class="post-metadata">

### Author: ![janglee](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/janglee/32/4035_2.png) [@janglee](https://discourse.processing.org/u/janglee)
#### Post date: [March 26, 2019, 8:10pm UTC](https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608/7 "2019-03-26T20:10:24Z")

</div>

Last two steps are what the trouble is. I can’t easily make it to scroll on perfect speed.Sometime it is so slow or some time it is fast enough to get selected all around from topic.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 28, 2019, 3:21pm UTC](https://discourse.processing.org/t/is-there-any-way-to-copy-the-code/9608/8 "2019-03-28T15:21:47Z")

</div>

> [@Copy code shortcut](https://discourse.processing.org/t/copy-code-shortcut/660/3):
>
> It looks like this feature is available as a theme component, here: I don’t have the ability to install components into the website, but from a quick glance it looks fairly straightforward – if it doesn’t add too much maintenance overhead fro admins @ProcessingOrg
